Otaceni fotek
This commit is contained in:
+7
-1
@@ -1,6 +1,6 @@
|
||||
import {defineStore} from "pinia";
|
||||
import {apolloWrapper} from "src/graphql/apollo";
|
||||
import {DELETE_PHOTO, EDIT_PHOTO, UPLOAD_PHOTO} from "src/graphql/mutations/photo";
|
||||
import {DELETE_PHOTO, EDIT_PHOTO, ROTATE_PHOTO, UPLOAD_PHOTO} from "src/graphql/mutations/photo";
|
||||
|
||||
export const usePhotosStore = defineStore('Photos', {
|
||||
state: () => ({
|
||||
@@ -35,6 +35,12 @@ export const usePhotosStore = defineStore('Photos', {
|
||||
return data.editPhoto;
|
||||
}).finally(() => this.isMutationRunning = false);
|
||||
},
|
||||
rotate(id, angle) {
|
||||
this.isMutationRunning = true;
|
||||
return apolloWrapper.mutate(ROTATE_PHOTO, {id, angle}).then(({data}) => {
|
||||
return data.rotatePhoto;
|
||||
}).finally(() => this.isMutationRunning = false);
|
||||
},
|
||||
delete(photoId) {
|
||||
return apolloWrapper.mutate(DELETE_PHOTO, {id: photoId}).then(({data}) => {
|
||||
return data.deletePhoto;
|
||||
|
||||
Reference in New Issue
Block a user