Editace fotek v modalu, lepsi datetime picker
This commit is contained in:
+12
-1
@@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user