Homepage, lepsi POI
This commit is contained in:
@@ -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;
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user