mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 16:34:02 +01:00
Fix studio editing (#1668)
This commit is contained in:
parent
7b3b2ae9ba
commit
0d4ab7f6f3
5 changed files with 12 additions and 11 deletions
|
|
@ -30,7 +30,7 @@ import {
|
|||
Modal,
|
||||
TagSelect,
|
||||
} from "src/components/Shared";
|
||||
import { ImageUtils } from "src/utils";
|
||||
import { ImageUtils, getStashIDs } from "src/utils";
|
||||
import { getCountryByISO } from "src/utils/country";
|
||||
import { useToast } from "src/hooks";
|
||||
import { Prompt, useHistory } from "react-router-dom";
|
||||
|
|
@ -380,10 +380,7 @@ export const PerformerEditPanel: React.FC<IPerformerDetails> = ({
|
|||
variables: {
|
||||
input: {
|
||||
...input,
|
||||
stash_ids: performerInput?.stash_ids?.map((s) => ({
|
||||
endpoint: s.endpoint,
|
||||
stash_id: s.stash_id,
|
||||
})),
|
||||
stash_ids: getStashIDs(performerInput?.stash_ids),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import {
|
|||
ImageInput,
|
||||
} from "src/components/Shared";
|
||||
import { useToast } from "src/hooks";
|
||||
import { ImageUtils, FormUtils, TextUtils } from "src/utils";
|
||||
import { ImageUtils, FormUtils, TextUtils, getStashIDs } from "src/utils";
|
||||
import { MovieSelect } from "src/components/Shared/Select";
|
||||
import { useFormik } from "formik";
|
||||
import { Prompt } from "react-router";
|
||||
|
|
@ -110,10 +110,7 @@ export const SceneEditPanel: React.FC<IProps> = ({
|
|||
}),
|
||||
tag_ids: (scene.tags ?? []).map((t) => t.id),
|
||||
cover_image: undefined,
|
||||
stash_ids: (scene.stash_ids ?? []).map((s) => ({
|
||||
stash_id: s.stash_id,
|
||||
endpoint: s.endpoint,
|
||||
})),
|
||||
stash_ids: getStashIDs(scene.stash_ids),
|
||||
};
|
||||
|
||||
type InputValues = typeof initialValues;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import * as yup from "yup";
|
|||
import Mousetrap from "mousetrap";
|
||||
import { Icon, StudioSelect, DetailsEditNavbar } from "src/components/Shared";
|
||||
import { Button, Form, Col, Row } from "react-bootstrap";
|
||||
import { FormUtils, ImageUtils } from "src/utils";
|
||||
import { FormUtils, ImageUtils, getStashIDs } from "src/utils";
|
||||
import { RatingStars } from "src/components/Scenes/SceneDetails/RatingStars";
|
||||
import { useFormik } from "formik";
|
||||
import { Prompt } from "react-router-dom";
|
||||
|
|
@ -74,6 +74,7 @@ export const StudioEditPanel: React.FC<IStudioEditPanel> = ({
|
|||
function getStudioInput(values: InputValues) {
|
||||
const input: Partial<GQL.StudioCreateInput | GQL.StudioUpdateInput> = {
|
||||
...values,
|
||||
stash_ids: getStashIDs(values.stash_ids),
|
||||
};
|
||||
|
||||
if (studio && studio.id) {
|
||||
|
|
|
|||
|
|
@ -12,3 +12,4 @@ export { default as getISOCountry } from "./country";
|
|||
export { default as useFocus } from "./focus";
|
||||
export { default as downloadFile } from "./download";
|
||||
export * from "./data";
|
||||
export { getStashIDs } from "./stashIds";
|
||||
|
|
|
|||
5
ui/v2.5/src/utils/stashIds.ts
Normal file
5
ui/v2.5/src/utils/stashIds.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
export const getStashIDs = (ids?: { stash_id: string; endpoint: string }[]) =>
|
||||
(ids ?? []).map(({ stash_id, endpoint }) => ({
|
||||
stash_id,
|
||||
endpoint,
|
||||
}));
|
||||
Loading…
Reference in a new issue