mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 09:31:12 -05:00
Update Novu migration to include username
This commit is contained in:
@@ -38,10 +38,10 @@ serve(async (req) => {
|
|||||||
|
|
||||||
const existingUserIds = existingPrefs?.map(p => p.user_id) || [];
|
const existingUserIds = existingPrefs?.map(p => p.user_id) || [];
|
||||||
|
|
||||||
// Fetch all profiles
|
// Fetch all profiles with usernames
|
||||||
let query = supabase
|
let query = supabase
|
||||||
.from('profiles')
|
.from('profiles')
|
||||||
.select('user_id');
|
.select('user_id, username');
|
||||||
|
|
||||||
// Only add the not filter if there are existing user IDs
|
// Only add the not filter if there are existing user IDs
|
||||||
if (existingUserIds.length > 0) {
|
if (existingUserIds.length > 0) {
|
||||||
@@ -96,6 +96,7 @@ serve(async (req) => {
|
|||||||
try {
|
try {
|
||||||
const subscriber = await novu.subscribers.identify(profile.user_id, {
|
const subscriber = await novu.subscribers.identify(profile.user_id, {
|
||||||
email,
|
email,
|
||||||
|
firstName: profile.username,
|
||||||
data: { userId: profile.user_id },
|
data: { userId: profile.user_id },
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -110,6 +111,7 @@ serve(async (req) => {
|
|||||||
results.push({
|
results.push({
|
||||||
userId: profile.user_id,
|
userId: profile.user_id,
|
||||||
email,
|
email,
|
||||||
|
username: profile.username,
|
||||||
success: true,
|
success: true,
|
||||||
});
|
});
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
|
|||||||
Reference in New Issue
Block a user