fix: cascade deleting of image properties

This commit is contained in:
2025-08-30 21:03:15 +01:00
parent 5d1c758451
commit 94ee8bdb7e
4 changed files with 15 additions and 10 deletions

View File

@@ -1,13 +1,13 @@
import { ImageComponentFullHeight } from "@components/image";
import { useSearchImageContext } from "@contexts/SearchImageContext";
import { useParams } from "@solidjs/router";
import { useNavigate, useParams } from "@solidjs/router";
import { For, type Component } from "solid-js";
import SolidjsMarkdown from "solidjs-markdown";
import { ListCard } from "@components/list-card";
import { deleteImage } from "@network/index";
export const ImagePage: Component = () => {
const { imageId } = useParams<{ imageId: string }>();
const nav = useNavigate();
const { userImages, lists, onDeleteImage } = useSearchImageContext();
@@ -16,7 +16,10 @@ export const ImagePage: Component = () => {
return (
<main class="flex flex-col items-center gap-4">
<div class="w-full bg-white rounded-xl p-4">
<ImageComponentFullHeight ID={imageId} onDelete={onDeleteImage()} />
<ImageComponentFullHeight ID={imageId} onDelete={(id) => {
onDeleteImage(id);
nav("/");
}} />
</div>
<div class="w-full bg-white rounded-xl p-4 flex flex-col gap-4">
<h2 class="font-bold text-2xl">Description</h2>