fix: resolve critical bugs and improve admin panel reliability
- Fix missing await in pets API route causing empty responses - Fix updateSetting to use upsert pattern instead of update-only - Create missing /api/admin/sounds/upload route (upload was broken) - Wire bulk delete actions in catalog table - Replace native confirm() with useConfirmDialog() across rooms and clone pages - Add error logging to silent catch blocks in radio actions and audit route - Add graceful degradation to devops health endpoint - Add cache eviction to clone icon route to prevent memory leak - Internationalize hardcoded Italian strings to English - Remove placeholder created_at fields from prefix API responses - Remove dead code and fix type errors in translations and import pages - Standardize PERMS import path in analytics export route
This commit is contained in:
1 parent
6f53ca514d
commit
1b817fe434
19 files changed
+255
-89
No files matched your search
@@ -2,8 +2,8 @@
|
||||
|
||||
import { Pencil } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { toggleCatalogPage } from "@/actions/catalog";
|
||||
import { toggleBcPage } from "@/actions/catalog-bc";
|
||||
import { deleteCatalogPage, toggleCatalogPage } from "@/actions/catalog";
|
||||
import { deleteBcTreePage, toggleBcPage } from "@/actions/catalog-bc";
|
||||
import { DataTable } from "@/components/admin/data-table";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
@@ -175,6 +175,20 @@ export function CatalogTable({
|
||||
},
|
||||
];
|
||||
|
||||
async function handleBulkAction(action: string, ids: (number | string)[]) {
|
||||
if (action !== "delete" || ids.length === 0) return;
|
||||
for (const id of ids) {
|
||||
const numId = typeof id === "string" ? Number(id) : id;
|
||||
if (Number.isInteger(numId) && numId > 0) {
|
||||
run(() =>
|
||||
isBc
|
||||
? deleteBcTreePage({ pageId: numId, mode: "reparent" })
|
||||
: deleteCatalogPage({ id: numId }),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<DataTable
|
||||
data={data}
|
||||
@@ -191,6 +205,7 @@ export function CatalogTable({
|
||||
]
|
||||
: undefined
|
||||
}
|
||||
onBulkAction={canEdit ? handleBulkAction : undefined}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user