mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Support for assigning any image from a gallery as the cover (#5053)
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
@@ -1526,6 +1526,34 @@ export const mutateAddGalleryImages = (input: GQL.GalleryAddInput) =>
|
||||
},
|
||||
});
|
||||
|
||||
export const mutateSetGalleryCover = (input: GQL.GallerySetCoverInput) =>
|
||||
client.mutate<GQL.SetGalleryCoverMutation>({
|
||||
mutation: GQL.SetGalleryCoverDocument,
|
||||
variables: input,
|
||||
update(cache, result) {
|
||||
if (!result.data?.setGalleryCover) return;
|
||||
|
||||
cache.evict({
|
||||
id: cache.identify({ __typename: "Gallery", id: input.gallery_id }),
|
||||
fieldName: "cover",
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
export const mutateResetGalleryCover = (input: GQL.GalleryResetCoverInput) =>
|
||||
client.mutate<GQL.ResetGalleryCoverMutation>({
|
||||
mutation: GQL.ResetGalleryCoverDocument,
|
||||
variables: input,
|
||||
update(cache, result) {
|
||||
if (!result.data?.resetGalleryCover) return;
|
||||
|
||||
cache.evict({
|
||||
id: cache.identify({ __typename: "Gallery", id: input.gallery_id }),
|
||||
fieldName: "cover",
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
export const mutateRemoveGalleryImages = (input: GQL.GalleryRemoveInput) =>
|
||||
client.mutate<GQL.RemoveGalleryImagesMutation>({
|
||||
mutation: GQL.RemoveGalleryImagesDocument,
|
||||
|
||||
Reference in New Issue
Block a user