MVP for API Key authentication

This commit is contained in:
ian
2025-12-03 14:51:59 +07:00
parent 9413c442df
commit 347e0192e2
17 changed files with 733 additions and 49 deletions
+11
View File
@@ -0,0 +1,11 @@
import { eq, or } from 'drizzle-orm'
import { db, table } from '~/db'
export async function checkMerchantExists(email: string, phone: string) {
const existingMerchant = await db.$count(table.merchants, or(
eq(table.merchants.contactEmail, email),
eq(table.merchants.contactPhone, phone),
))
return existingMerchant > 0
}