mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 08:31:12 -05:00
Fix edge function console statements
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { serve } from "https://deno.land/std@0.190.0/http/server.ts";
|
||||
import { createClient } from "https://esm.sh/@supabase/supabase-js@2.57.4";
|
||||
import { startRequest, endRequest } from "../_shared/logger.ts";
|
||||
import { edgeLogger, startRequest, endRequest } from "../_shared/logger.ts";
|
||||
|
||||
const corsHeaders = {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
@@ -176,7 +176,8 @@ serve(async (req) => {
|
||||
is_duplicate: true
|
||||
}).eq('id', existingLog.id);
|
||||
|
||||
console.log('Duplicate notification prevented:', {
|
||||
edgeLogger.info('Duplicate notification prevented', {
|
||||
action: 'notify_user_submission_status',
|
||||
userId: user_id,
|
||||
idempotencyKey,
|
||||
submissionId: submission_id,
|
||||
@@ -203,7 +204,8 @@ serve(async (req) => {
|
||||
);
|
||||
}
|
||||
|
||||
console.log('Sending notification to user:', {
|
||||
edgeLogger.info('Sending notification to user', {
|
||||
action: 'notify_user_submission_status',
|
||||
userId: user_id,
|
||||
workflowId,
|
||||
entityName,
|
||||
@@ -241,7 +243,7 @@ serve(async (req) => {
|
||||
}
|
||||
});
|
||||
|
||||
console.log('User notification sent successfully:', notificationResult);
|
||||
edgeLogger.info('User notification sent successfully', { action: 'notify_user_submission_status', requestId: tracking.requestId, result: notificationResult });
|
||||
|
||||
endRequest(tracking, 200);
|
||||
|
||||
@@ -262,7 +264,7 @@ serve(async (req) => {
|
||||
);
|
||||
} catch (error: unknown) {
|
||||
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
||||
console.error('Error notifying user about submission status:', errorMessage);
|
||||
edgeLogger.error('Error notifying user about submission status', { action: 'notify_user_submission_status', requestId: tracking.requestId, error: errorMessage });
|
||||
|
||||
endRequest(tracking, 500, errorMessage);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user