HotTRDealsBackend/db/seller.db.js
2026-01-23 17:28:21 +00:00

29 lines
517 B
JavaScript

const { PrismaClient } = require("@prisma/client")
const prisma = new PrismaClient()
async function findSeller(where, options = {}) {
return prisma.seller.findFirst({
where,
include: options.include || undefined,
select: options.select || undefined,
})
}
async function findSellerByDomain(domain) {
return prisma.seller.findFirst({
where: {
domains: {
some: {
domain: domain,
},
},
},
})
}
module.exports = {
findSeller,
findSellerByDomain,
}