Change image edit to recreate palettes

This commit is contained in:
2025-06-28 00:12:24 +02:00
parent c7a9c68605
commit 9f0807b0fc
16 changed files with 737 additions and 185 deletions

View File

@ -19,8 +19,8 @@ import { toast } from "sonner";
import * as z from "zod/v4";
type ImageWithItems = Image & {
album: Album,
artist: Artist,
album: Album | null,
artist: Artist | null,
colors: ImageColor[],
extractColors: ExtractColor[],
metadata: ImageMetadata[],
@ -28,9 +28,11 @@ type ImageWithItems = Image & {
stats: ImageStats[],
theme: ThemeSeed[],
variants: ImageVariant[],
palettes: ColorPalette[] & {
items: ColorPaletteItem[]
}
palettes: (
ColorPalette & {
items: ColorPaletteItem[]
}
)[]
};
export default function EditImageForm({ image, artists, albums }: { image: ImageWithItems, artists: Artist[], albums: Album[] }) {
@ -64,7 +66,6 @@ export default function EditImageForm({ image, artists, albums }: { image: Image
const updatedImage = await updateImage(values, image.id)
if (updatedImage) {
toast.success("Image updated")
router.push(`/images`)
}
}