MVP for API Key authentication
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user