| const { createClient } = require('@supabase/supabase-js'); |
| const dotenv = require('dotenv'); |
| const path = require('path'); |
|
|
| dotenv.config({ path: path.resolve(__dirname, '../../../.env.local') }); |
|
|
| const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL; |
| const supabaseServiceKey = process.env.SUPABASE_SERVICE_ROLE_KEY; |
|
|
| if (!supabaseUrl || !supabaseServiceKey) { |
| console.error('Missing Supabase credentials'); |
| process.exit(1); |
| } |
|
|
| const supabase = createClient(supabaseUrl, supabaseServiceKey); |
| const orgId = '4584c0bd-128d-40c1-b212-4ac7d51b554e'; |
|
|
| async function setupOrg() { |
| const branding = { |
| logo_url: 'https://tenderhubkenya.vercel.app/logo.png', |
| primary_color: '#2563eb', |
| theme: 'dark', |
| company_name: 'Test Corp - White Label' |
| }; |
|
|
| console.log('Updating organization:', orgId); |
| const { data, error } = await supabase |
| .from('organizations') |
| .update({ |
| plan_type: 'WHITE_LABEL', |
| white_label_branding: branding |
| }) |
| .eq('id', orgId); |
|
|
| if (error) { |
| console.error('Error updating organization:', error); |
| } else { |
| console.log('Organization updated successfully.'); |
| } |
| } |
|
|
| setupOrg(); |
|
|