feat(audit): implement page view logging for membership confirmation and analysis results

This commit is contained in:
Danel Kungla
2025-08-14 09:37:03 +03:00
parent 536f915c69
commit bbb5e83ed9
3 changed files with 75 additions and 28 deletions

View File

@@ -1,11 +1,16 @@
import { getSupabaseServerClient } from '@kit/supabase/server-client';
export enum PAGE_VIEW_ACTION {
VIEW_ANALYSIS_RESULTS = 'VIEW_ANALYSIS_RESULTS',
REGISTRATION_SUCCESS = 'REGISTRATION_SUCCESS',
}
export const createPageViewLog = async ({
accountId,
action,
}: {
accountId: string;
action: 'VIEW_ANALYSIS_RESULTS';
action: PAGE_VIEW_ACTION;
}) => {
try {
const supabase = getSupabaseServerClient();
@@ -32,4 +37,4 @@ export const createPageViewLog = async ({
} catch (error) {
console.error('Failed to insert page view log', error);
}
}
};