Refactor versioning utility functions

This commit is contained in:
gpt-engineer-app[bot]
2025-10-15 17:47:14 +00:00
parent 4e7d528c64
commit 96a5d235e9
11 changed files with 1251 additions and 140 deletions

View File

@@ -372,8 +372,11 @@ export function useModerationQueueManager(config: ModerationQueueManagerConfig):
toast({
title: `Content ${action}`,
description: `The ${item.type} has been ${action}`,
description: `The ${item.type} has been ${action}. Version history updated.`,
});
// Refresh stats to update counts
queue.refreshStats();
} catch (error: any) {
console.error("Error moderating content:", error);
@@ -415,10 +418,13 @@ export function useModerationQueueManager(config: ModerationQueueManagerConfig):
if (error) throw error;
toast({
title: "Submission deleted",
description: "The submission has been permanently deleted",
});
toast({
title: "Submission deleted",
description: "The submission has been permanently deleted",
});
// Refresh stats to update counts
queue.refreshStats();
} catch (error: any) {
console.error("Error deleting submission:", error);
@@ -454,6 +460,9 @@ export function useModerationQueueManager(config: ModerationQueueManagerConfig):
title: "Reset Complete",
description: "Submission and all items have been reset to pending status",
});
// Refresh stats to update counts
queue.refreshStats();
setItems((prev) => prev.filter((i) => i.id !== item.id));
} catch (error: any) {
@@ -516,6 +525,9 @@ export function useModerationQueueManager(config: ModerationQueueManagerConfig):
title: "Retry Complete",
description: `Processed ${failedItems.length} failed item(s)`,
});
// Refresh stats to update counts
queue.refreshStats();
} catch (error: any) {
console.error("Error retrying failed items:", error);
toast({