fix: cascade deleting of image properties
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user