Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
41d3526b12
commit
99888be948
@@ -171,6 +171,10 @@ function ArchivePage() {
|
||||
}, [rows]);
|
||||
|
||||
const deleteRow = async (id: string) => {
|
||||
if (isLocked) {
|
||||
toast.error("Tab is locked. Unlock it to delete records.");
|
||||
return;
|
||||
}
|
||||
if (!confirm("Delete this record?")) return;
|
||||
const { error } = await supabase.from("archive_records").delete().eq("id", id);
|
||||
if (error) {
|
||||
@@ -184,6 +188,10 @@ function ArchivePage() {
|
||||
|
||||
const deleteAllInCategory = async () => {
|
||||
if (!activeCategory) return;
|
||||
if (isLocked) {
|
||||
toast.error("Tab is locked. Unlock it to clear records.");
|
||||
return;
|
||||
}
|
||||
if (!confirm(`Delete ALL ${totalCount} records in "${activeCategory.label}"? This cannot be undone.`)) return;
|
||||
const { error } = await supabase.from("archive_records").delete().eq("category_id", activeCategory.id);
|
||||
if (error) {
|
||||
|
||||
Reference in New Issue
Block a user