Editace fotek v modalu, lepsi datetime picker

This commit is contained in:
Michal Kváček
2023-07-10 08:12:48 +02:00
parent 3d88397d21
commit bbb21278fd
18 changed files with 274 additions and 103 deletions
+12 -1
View File
@@ -1,6 +1,6 @@
import {defineStore} from "pinia";
import {apolloWrapper} from "src/graphql/apollo";
import {UPLOAD_PHOTO} from "src/graphql/mutations/photo";
import {DELETE_PHOTO, EDIT_PHOTO, UPLOAD_PHOTO} from "src/graphql/mutations/photo";
export const usePhotosStore = defineStore('photos', {
@@ -24,5 +24,16 @@ export const usePhotosStore = defineStore('photos', {
return data.uploadPhoto;
})
},
update(id, formData) {
return apolloWrapper.mutate(EDIT_PHOTO, {id, input: formData}).then(({data}) => {
return data.editPhoto;
})
},
delete(photoId) {
return apolloWrapper.mutate(DELETE_PHOTO, {id: photoId}).then(({data}) => {
return data.deletePhoto;
});
}
}
});