mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 13:11:12 -05:00
feat: Implement user topic subscription
This commit is contained in:
@@ -203,6 +203,18 @@ serve(async (req) => {
|
||||
const duration = endRequest(tracking);
|
||||
console.log('Subscriber created successfully:', subscriber.data, { requestId: tracking.requestId, duration });
|
||||
|
||||
// Add subscriber to "users" topic for global announcements
|
||||
try {
|
||||
console.log('Adding subscriber to "users" topic...', { subscriberId });
|
||||
await novu.topics.addSubscribers('users', {
|
||||
subscribers: [subscriberId],
|
||||
});
|
||||
console.log('Successfully added subscriber to "users" topic', { subscriberId });
|
||||
} catch (topicError: any) {
|
||||
// Non-blocking - log error but don't fail the request
|
||||
console.error('Failed to add subscriber to "users" topic:', topicError.message, { subscriberId });
|
||||
}
|
||||
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
success: true,
|
||||
|
||||
Reference in New Issue
Block a user