Skip to content

Commit 4ca9208

Browse files
committed
Finish destroy
1 parent 1ba9af6 commit 4ca9208

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ In your component:
6464
- [x] Setup apollo integration
6565
- [x] Implement fetch action
6666
- [x] Make sure the reactivity works
67+
- [x] destroy, push & persist
6768
- [ ] Playground project (GraphQL API + Vue/Vuex-ORM app)
68-
- [ ] Tests
69+
- [x] Tests
6970
- [ ] Docs & document schema expectations
70-
- [ ] Deletions & persist
7171
- [ ] Subscriptions
7272
- [ ] Attach multiple GraphQL APIs with different models in the same app
7373

dist/vuex-orm-apollo.esm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8611,8 +8611,8 @@ var VuexORMApollo = /** @class */ (function () {
86118611
return __generator(this, function (_c) {
86128612
switch (_c.label) {
86138613
case 0:
8614-
model = this.getModel(state.$name);
86158614
if (!id) return [3 /*break*/, 2];
8615+
model = this.getModel(state.$name);
86168616
query = this.queryBuilder.buildMutation(model, id, 'delete');
86178617
// Send GraphQL Mutation
86188618
return [4 /*yield*/, this.apolloClient.mutate({

src/vuex-orm-apollo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ export default class VuexORMApollo {
157157
* @returns {Promise<void>}
158158
*/
159159
private async destroy ({ state, dispatch }: ActionParams, { id }: ActionParams): Promise<void> {
160-
const model = this.getModel(state.$name);
161160

162161
if (id) {
162+
const model = this.getModel(state.$name);
163163
const query = this.queryBuilder.buildMutation(model, id, 'delete');
164164

165165
// Send GraphQL Mutation

0 commit comments

Comments
 (0)