mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-11-02 02:19:43 +00:00
feat(content): add catalogue review metadata
Add reversible review states, audit history, and super-admin controls for catalogue entities without changing current client visibility. Stage 30 high-risk production packs for archival review, cap generated content at non-explicit language, and preserve a checksummed pre-change production catalogue snapshot.
This commit is contained in:
1 parent
b43804d8fd
commit
94c76535a4
30 files changed
+46906
-128
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import type { ContentReviewStatus } from '@sauci/shared';
|
||||
import { auditedSupabase } from '@/hooks/useAuditedSupabase';
|
||||
export { CONTENT_STATUS_LABELS } from '@/lib/contentReviewStatus';
|
||||
|
||||
export type ReviewableContentTable =
|
||||
| 'categories'
|
||||
| 'question_packs'
|
||||
| 'questions'
|
||||
| 'dare_packs'
|
||||
| 'dares';
|
||||
|
||||
export async function updateContentReviewStatus(
|
||||
table: ReviewableContentTable,
|
||||
id: string,
|
||||
status: ContentReviewStatus,
|
||||
reason: string,
|
||||
): Promise<void> {
|
||||
const normalizedReason = reason.trim();
|
||||
if (!normalizedReason) {
|
||||
throw new Error('A review reason is required');
|
||||
}
|
||||
|
||||
const { error } = await auditedSupabase.update(table, id, {
|
||||
content_status: status,
|
||||
content_review_reason: normalizedReason,
|
||||
});
|
||||
|
||||
if (error) throw error;
|
||||
}
|
||||
Reference in new issue
Block a user