2
0

fix(share): 🐛 Delete domain when Vercel doesn't have it

This commit is contained in:
Baptiste Arnaud
2022-05-02 07:09:43 -07:00
parent 1becdad79e
commit 28710dddc7

View File

@ -12,7 +12,9 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
if (user.id !== id) return res.status(401).send({ message: 'Forbidden' })
if (req.method === 'DELETE') {
const domain = req.query.domain.toString()
try {
await deleteDomainOnVercel(domain)
} catch {}
const customDomains = await prisma.customDomain.delete({
where: { name: domain },
})