Spaces:
Sleeping
Sleeping
Nathan commited on
Commit ·
df9cf4e
1
Parent(s): 42f6d0c
Fix: Hardened channel link logic to prevent placeholder conflicts
Browse files518 unmodified lines519520521522522523524525526527524525528529530518 unmodified lines };
if (placeholder) { upsertData.id = placeholder.id; // Use the internal Supabase UUID of the placeholder // If we found a placeholder, update it directly to avoid primary key conflicts await db.from('channels').update(upsertData).eq('id', placeholder.id); } else { // Otherwise upsert by channel_id await db.from('channels').upsert(upsertData, { onConflict: 'channel_id' }); }
await db.from('channels').upsert(upsertData, { onConflict: 'channel_id' }); } res.send('<h1>✅ YouTube Connected!</h1><p>Close this and refresh your dashboard.</p>'); } catch (e) {server.js+5-3