updated cards slightly, just need to pull on a remote

This commit is contained in:
Zoe
2022-12-09 15:32:49 -06:00
parent 5d422a15b3
commit 549d2513a5
12 changed files with 892 additions and 1036 deletions

View File

@@ -16,10 +16,12 @@ serve(async (req) => {
const supabase = createClient(Deno.env.get('SUPABASE_URL'), Deno.env.get('SUPABASE_ANON_KEY'))
const { email, name } = await req.json()
if (!name || !email || !emailRegex.test(email)) throw new Error(
if (!email || !emailRegex.test(email)) throw new Error(
'Please provide a valid email address or name'
)
const name = email.split('@')[0]
const { data, error } = await supabase
.from('subscribers')
.upsert({ name: name, email: email })