diff --git a/README.md b/README.md index 25eae614..8d4581bc 100755 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@
This client is a thin wrapper for the Storyblok API's to use in Node.js and the browser.
+ + + +This client is a thin wrapper for the Storyblok API's to use in Node.js and the browser.
@@ -214,16 +214,13 @@ Exceptions will be thrown as an object with the following structure:
message: Error // an Error object with the error message
status: number
response: ISbResponse
- message: Error // an Error object with the error message
- status: number
- response: ISbResponse
}
```
where,
```typescript
-iinterface ISbResponse {
+interface ISbResponse {
data: any
status: number
statusText: string
@@ -275,10 +272,6 @@ const data = {
name: 'xy',
slug: 'xy',
},
- story: {
- name: 'xy',
- slug: 'xy',
- },
}
Storyblok.get(
@@ -291,15 +284,6 @@ Storyblok.get(
cache: 'no-cache',
body: JSON.stringify(data),
}
- 'cdn/stories/home',
- {
- version: 'draft',
- },
- {
- mode: 'cors',
- cache: 'no-cache',
- body: JSON.stringify(data),
- }
)
.then((response) => {
console.log(response)
@@ -307,12 +291,6 @@ Storyblok.get(
.catch((error) => {
console.error(error)
})
- .then((response) => {
- console.log(response)
- })
- .catch((error) => {
- console.error(error)
- })
```
### Method `Storyblok#get`
@@ -331,7 +309,6 @@ With this method you can get single or multiple items. The multiple items are pa
```javascript
Storyblok.get('cdn/stories/home', {
version: 'draft',
- version: 'draft',
})
.then((response) => {
console.log(response)
@@ -339,12 +316,6 @@ Storyblok.get('cdn/stories/home', {
.catch((error) => {
console.log(error)
})
- .then((response) => {
- console.log(response)
- })
- .catch((error) => {
- console.log(error)
- })
```
#### Method `Storyblok#getAll`
@@ -364,7 +335,6 @@ With this method you can get all items at once.
```javascript
Storyblok.getAll('cdn/stories', {
version: 'draft',
- version: 'draft',
})
.then((stories) => {
console.log(stories) // an array
@@ -372,12 +342,6 @@ Storyblok.getAll('cdn/stories', {
.catch((error) => {
console.log(error)
})
- .then((stories) => {
- console.log(stories) // an array
- })
- .catch((error) => {
- console.log(error)
- })
```
#### Method `Storyblok#post` (only management api)
@@ -394,7 +358,6 @@ Storyblok.getAll('cdn/stories', {
```javascript
Storyblok.post('spaces/