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