Skip to content
Snippets Groups Projects

Resolve "Frontend for Models"

Merged Julian requested to merge 1-frontend-for-models into master
2 files
+ 13
0
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -104,6 +104,7 @@
@@ -104,6 +104,7 @@
<slot-card
<slot-card
:item="slot"
:item="slot"
:disabled="$apollo.queries.items.loading"
:disabled="$apollo.queries.items.loading"
 
@click:delete="deleteSingularSlot"
/>
/>
</template>
</template>
</div>
</div>
@@ -214,6 +215,7 @@ export default {
@@ -214,6 +215,7 @@ export default {
}),
}),
]
]
);
);
 
// FIXME: Optimistic response; delete from store
await Promise.all(
await Promise.all(
this.items
this.items
.filter(slot => slot.weekday === src)
.filter(slot => slot.weekday === src)
@@ -233,8 +235,18 @@ export default {
@@ -233,8 +235,18 @@ export default {
})
})
})
})
)
)
 
// FIXME: Optimistic response; add to store?
await this.$apollo.queries.items.refetch();
await this.$apollo.queries.items.refetch();
this.loading[src] = false;
this.loading[src] = false;
 
},
 
deleteSingularSlot(slot) {
 
this.$apollo.mutate({
 
mutation: deleteSlot,
 
variables: {
 
id: slot.id,
 
},
 
}).then(() => console.log("Deleted", slot))
 
// FIXME: Optimistic response; delete from store
}
}
},
},
}
}
Loading