feat(notifications): alert oversight review queues
This commit is contained in:
@@ -4,6 +4,7 @@ import { getPermissions } from '$lib/server/auth/authorization';
|
||||
import type { AuthUser } from '$lib/server/auth/session';
|
||||
import { recordIsacAudit } from '$lib/server/audit';
|
||||
import { getContributorMode } from '$lib/server/contributor-mode';
|
||||
import { notifyOversightReview } from '$lib/server/oversight-notifications';
|
||||
|
||||
export const DATA_MODULES = ['configuration', 'attributes', 'talents', 'brands', 'gear', 'weapons', 'weaponmods', 'gearmods', 'protocols', 'skillchips'] as const;
|
||||
export type DataModule = typeof DATA_MODULES[number];
|
||||
@@ -157,6 +158,13 @@ export async function queueDataProposal(user: AuthUser, module: DataModule, acti
|
||||
before: null,
|
||||
after: { module, action, entityId, draftEntityId, dependencies: dependencies.map((item) => item.id), summary }
|
||||
});
|
||||
await notifyOversightReview({
|
||||
category: 'data_changes',
|
||||
itemId: id,
|
||||
title: 'Data change awaiting review',
|
||||
summary: `${summary} was submitted to the Oversight queue and is ready for review.`,
|
||||
link: `/isac/data-moderation?search=${encodeURIComponent(name || entityId || id)}`
|
||||
}).catch((error) => console.error('Unable to notify Data Oversight reviewers', error));
|
||||
return { id, entityId, draftEntityId };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user