Prevent studio parent id and scene rating from being unset when tagged (#927)

This commit is contained in:
InfiniteTF 2020-11-06 03:14:17 +01:00 committed by GitHub
parent 5f482b7b8a
commit 8a04e5df62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View File

@ -6,4 +6,7 @@ fragment SlimStudioData on Studio {
endpoint
stash_id
}
parent_studio {
id
}
}

View File

@ -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 ?? []),
{

View File

@ -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,