mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 06:51:13 -05:00
feat: Implement Novu username and update functionality
This commit is contained in:
@@ -71,6 +71,30 @@ class NotificationService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an existing Novu subscriber's profile information
|
||||
*/
|
||||
async updateSubscriber(subscriberData: SubscriberData): Promise<{ success: boolean; error?: string }> {
|
||||
if (!this.isNovuEnabled) {
|
||||
console.warn('Novu is not configured. Skipping subscriber update.');
|
||||
return { success: false, error: 'Novu not configured' };
|
||||
}
|
||||
|
||||
try {
|
||||
const { data, error } = await supabase.functions.invoke('update-novu-subscriber', {
|
||||
body: subscriberData,
|
||||
});
|
||||
|
||||
if (error) throw error;
|
||||
|
||||
console.log('Novu subscriber updated successfully');
|
||||
return { success: true };
|
||||
} catch (error: any) {
|
||||
console.error('Error updating Novu subscriber:', error);
|
||||
return { success: false, error: error.message };
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update subscriber preferences in Novu
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user