Phase 2 refinements: Firebase config, dev environment fixes, phase 3 requirement draft
- Integrated Firebase SDK in both Flutter apps (google-services, firebase_options) - Fixed auth flow, API client, and pairing/status blocs for dev environment - Added full Flutter project scaffolds (android, ios, web, etc.) - Added phase 3 chat engine requirement document - Added bugreport zip pattern to gitignore Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,10 +2,17 @@ import { getDb } from '../db/client.js'
|
||||
|
||||
const sql = getDb()
|
||||
|
||||
export const createAnonymousCustomer = async ({ display_name }) => {
|
||||
export const createAnonymousCustomer = async ({ display_name, firebase_uid }) => {
|
||||
// Return existing customer if already linked to this Firebase UID
|
||||
const [existing] = await sql`
|
||||
SELECT id, display_name, is_anonymous, created_at
|
||||
FROM customers WHERE firebase_uid = ${firebase_uid}
|
||||
`
|
||||
if (existing) return existing
|
||||
|
||||
const [customer] = await sql`
|
||||
INSERT INTO customers (display_name, is_anonymous)
|
||||
VALUES (${display_name}, true)
|
||||
INSERT INTO customers (display_name, is_anonymous, firebase_uid)
|
||||
VALUES (${display_name}, true, ${firebase_uid})
|
||||
RETURNING id, display_name, is_anonymous, created_at
|
||||
`
|
||||
return customer
|
||||
|
||||
Reference in New Issue
Block a user