NextJS_DOC/pages/api/DeleteUser.js

12 lines
283 B
JavaScript
Raw Permalink Normal View History

2023-03-24 10:11:04 +00:00
import prisma from '../../lib/Prisma'
export default async function handle(req, res) {
console.log(req.query.id);
const id = req.query.id;
const result = await prisma.users.delete({
where: {
id: parseInt(id),
}
});
res.json(result);
}