mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 21:11:22 -05:00
feat: Implement full type safety plan
This commit is contained in:
@@ -22,7 +22,15 @@ serve(async (req) => {
|
||||
secretKey: novuApiKey
|
||||
});
|
||||
|
||||
const { subscriberId, email, firstName, lastName, phone, avatar, data } = await req.json();
|
||||
const { subscriberId, email, firstName, lastName, phone, avatar, data } = await req.json() as {
|
||||
subscriberId: string;
|
||||
email?: string;
|
||||
firstName?: string;
|
||||
lastName?: string;
|
||||
phone?: string;
|
||||
avatar?: string;
|
||||
data?: Record<string, unknown>;
|
||||
};
|
||||
|
||||
console.log('Updating Novu subscriber:', { subscriberId, email, firstName });
|
||||
|
||||
@@ -47,13 +55,14 @@ serve(async (req) => {
|
||||
status: 200,
|
||||
}
|
||||
);
|
||||
} catch (error: any) {
|
||||
console.error('Error updating Novu subscriber:', error);
|
||||
} catch (error: unknown) {
|
||||
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
||||
console.error('Error updating Novu subscriber:', errorMessage);
|
||||
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
success: false,
|
||||
error: error.message,
|
||||
error: errorMessage,
|
||||
}),
|
||||
{
|
||||
headers: { ...corsHeaders, 'Content-Type': 'application/json' },
|
||||
|
||||
Reference in New Issue
Block a user