mirror of https://github.com/stashapp/stash.git
Prevent studio parent id and scene rating from being unset when tagged (#927)
This commit is contained in:
parent
5f482b7b8a
commit
8a04e5df62
|
@ -6,4 +6,7 @@ fragment SlimStudioData on Studio {
|
|||
endpoint
|
||||
stash_id
|
||||
}
|
||||
parent_studio {
|
||||
id
|
||||
}
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ const StashSearchResult: React.FC<IStashSearchResultProps> = ({
|
|||
studioID = studioCreateResult.data.studioCreate.id;
|
||||
} else if (studio.type === "update") {
|
||||
setSaveState("Saving studio stashID");
|
||||
const res = await updateStudioStashID(studio.data.id, [
|
||||
const res = await updateStudioStashID(studio.data, [
|
||||
...studio.data.stash_ids,
|
||||
{ stash_id: scene.studio.stash_id, endpoint },
|
||||
]);
|
||||
|
@ -284,6 +284,7 @@ const StashSearchResult: React.FC<IStashSearchResultProps> = ({
|
|||
cover_image: imgData,
|
||||
url: scene.url,
|
||||
tag_ids: updatedTags,
|
||||
rating: stashScene.rating,
|
||||
stash_ids: [
|
||||
...(stashScene?.stash_ids ?? []),
|
||||
{
|
||||
|
|
|
@ -111,10 +111,14 @@ export const useUpdateStudioStashID = () => {
|
|||
onError: (errors) => errors,
|
||||
});
|
||||
|
||||
const handleUpdate = (studioID: string, stashIDs: GQL.StashIdInput[]) =>
|
||||
const handleUpdate = (
|
||||
studio: GQL.SlimStudioDataFragment,
|
||||
stashIDs: GQL.StashIdInput[]
|
||||
) =>
|
||||
updateStudio({
|
||||
variables: {
|
||||
id: studioID,
|
||||
id: studio.id,
|
||||
parent_id: studio.parent_studio?.id,
|
||||
stash_ids: stashIDs.map((s) => ({
|
||||
stash_id: s.stash_id,
|
||||
endpoint: s.endpoint,
|
||||
|
|
Loading…
Reference in New Issue