Skip to content

Commit

Permalink
Make image width/height required
Browse files Browse the repository at this point in the history
  • Loading branch information
InfiniteStash committed Feb 17, 2024
1 parent 977c1c3 commit ab71dfd
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/editCard/ModifyEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ type OldDetails = EditFragment["old_details"];
type Options = EditFragment["options"];

type Image = {
height?: number | undefined;
height: number;
id: string;
url: string;
width?: number | undefined;
width: number;
};

// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/editImages/editImages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ const EditImages: FC<EditImagesProps> = ({
if (i.data?.imageCreate?.id) {
if (!images.some((image) => image.id === i.data?.imageCreate?.id)) {
append(i.data.imageCreate);
console.log(i.data.imageCreate);
}
setFile(undefined);
setImageData("");
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/imageChangeRow/ImageChangeRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { FC } from "react";
import { Col, Row } from "react-bootstrap";

type Image = {
height?: number | undefined;
height: number;
id: string;
url: string;
width?: number | undefined;
width: number;
};

const CLASSNAME = "ImageChangeRow";
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/scenes/sceneForm/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ export const SceneSchema = yup.object({
yup.object({
id: yup.string().required(),
url: yup.string().required(),
width: yup.number().default(0),
height: yup.number().default(0),
width: yup.number().required(),
height: yup.number().required(),
})
)
.required(),
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/studios/studioForm/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export const StudioSchema = yup.object({
yup.object({
id: yup.string().required(),
url: yup.string().required(),
width: yup.number().default(0),
height: yup.number().default(0),
width: yup.number().required(),
height: yup.number().required(),
})
)
.required(),
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utils/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const diffImages = (
) =>
diffArray(
(newImages ?? []).flatMap((i) =>
i.id && i.url
i.id && i.url && i.height && i.width
? [
{
id: i.id,
Expand Down

0 comments on commit ab71dfd

Please sign in to comment.