This commit is contained in:
Michal Kváček
2023-08-26 11:45:50 +02:00
parent ccc8ff22e2
commit dcc3230cbe
18 changed files with 132 additions and 42 deletions
+6 -3
View File
@@ -8,15 +8,18 @@ export const useUserStore = defineStore('LoggedUser', {
state: () => ({
user: {},
isRefreshing: false,
isMutationRunning: false,
}),
actions: {
update(id, formData) {
apolloWrapper.mutate(EDIT_USER, {id, input: formData}).then((response) => {
update(formData) {
this.isMutationRunning = true;
apolloWrapper.mutate(EDIT_USER, {input: formData}).then((response) => {
const user = response.data?.editLoggedUser;
this.user = user;
return user;
});
}).finally(() => this.isMutationRunning = false);
},
fetchLoggedUserDetail() {