You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
412 B
JavaScript
23 lines
412 B
JavaScript
import { PrismaClient } from "@prisma/client";
|
|
const prisma = new PrismaClient();
|
|
|
|
export default async(req, res) => {
|
|
|
|
const { uuid } = req.query;
|
|
|
|
try {
|
|
await prisma.records.delete({
|
|
where: {
|
|
uuid
|
|
},
|
|
});
|
|
} catch (error) {
|
|
res.json({ ok: false, error: "UUID not found or internal error." });
|
|
console.log(error);
|
|
return;
|
|
}
|
|
|
|
res.status(200).json({ ok: true })
|
|
|
|
}
|