Skip to content

Commit afe646f

Browse files
committed
Add missing documentation for isSaved property
1 parent 94528b2 commit afe646f

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

docs/api/response.md

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ The Response object is what gets returned when you make API call via Request obj
2020

2121
The result of Vuex ORM persistent method.
2222

23+
### isSaved
24+
25+
- **`isSaved: boolean`**
26+
27+
Whether the response data is persisted to the store or not.
28+
2329
### model
2430

2531
- **`model: typeof Model`**

docs/guide/usage.md

+14
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,17 @@ if (result.response.data.error) {
117117
// Persist in the store otherwise.
118118
result.save()
119119
````
120+
121+
You can check to see if the response data is already stored in the store or not with `isSaved` property.
122+
123+
```js
124+
const result = await User.api().get('/api/users', {
125+
save: false
126+
})
127+
128+
result.isSaved // <- false
129+
130+
result.save()
131+
132+
result.isSaved // <- true
133+
```

0 commit comments

Comments
 (0)