Spaces:
Sleeping
Sleeping
Nathan commited on
Commit ·
df9cf4e
1
Parent(s): 42f6d0c
Fix: Hardened channel link logic to prevent placeholder conflicts
Browse files518 unmodified lines519520521522523524525526527528518 unmodified lines};if (placeholder) {upsertData.id = placeholder.id; // Use the internal Supabase UUID of the placeholder}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) {518 unmodified lines519520521522523524525526527528529530518 unmodified lines};if (placeholder) {// If we found a placeholder, update it directly to avoid primary key conflictsawait db.from('channels').update(upsertData).eq('id', placeholder.id);} else {// Otherwise upsert by channel_idawait 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