File tree 2 files changed +20
-0
lines changed
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,12 @@ The Response object is what gets returned when you make API call via Request obj
20
20
21
21
The result of Vuex ORM persistent method.
22
22
23
+ ### isSaved
24
+
25
+ - ** ` isSaved: boolean ` **
26
+
27
+ Whether the response data is persisted to the store or not.
28
+
23
29
### model
24
30
25
31
- ** ` model: typeof Model ` **
Original file line number Diff line number Diff line change @@ -117,3 +117,17 @@ if (result.response.data.error) {
117
117
// Persist in the store otherwise.
118
118
result.save()
119
119
` ` ` `
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
+ ```
You can’t perform that action at this time.
0 commit comments