Homepage, lepsi POI

This commit is contained in:
Michal Kváček
2023-08-23 21:40:32 +02:00
parent 8c3b8d19dd
commit 19b078b43c
33 changed files with 370 additions and 141 deletions
+5 -1
View File
@@ -2,6 +2,7 @@ import {defineStore} from 'pinia'
import {apolloWrapper} from "src/graphql/apollo";
import {COPILOT_DETAIL, COPILOTS_LIST} from "src/graphql/queries/copilots";
import {CREATE_COPILOT, EDIT_COPILOT} from "src/graphql/mutations/copilot";
import {updateInItems} from "stores/helpers";
export const useCopilotsStore = defineStore('SecondPilots', {
state: () => ({
@@ -28,7 +29,10 @@ export const useCopilotsStore = defineStore('SecondPilots', {
},
update(id, formData) {
return apolloWrapper.mutate(EDIT_COPILOT, {id: id, input: formData}).then(({data}) => {
return data.editCopilot;
const copilot = data.editCopilot;
updateInItems(this.items, "id", copilot);
return copilot;
});
},
}