fix: upload image

This commit is contained in:
2026-06-03 03:19:46 +03:30
parent 6fa30eb29a
commit 821b85d4fe
5 changed files with 373 additions and 131 deletions
+3 -2
View File
@@ -59,10 +59,11 @@ export default function CommentsPage() {
}
async function confirmDelete() {
if (!deleting || !query) return;
if (!deleting || !query || deleting.id == null) return;
setRemoving(true);
try {
await apiFetch(`/comments/${query.type}/${query.id}`, {
// Delete targets the comment's own id: /comments/{type}/{id}/{commentId}
await apiFetch(`/comments/${query.type}/${query.id}/${deleting.id}`, {
method: "DELETE",
});
toast.success("نظر حذف شد.");