feat: Implement rest API endpoint to delete user

This commit is contained in:
Faruk AYDIN
2024-07-16 15:16:40 +02:00
parent dc56e7f883
commit ec2863d218
4 changed files with 83 additions and 1 deletions

View File

@@ -0,0 +1,10 @@
import User from '../../../../../models/user.js';
export default async (request, response) => {
const id = request.params.userId;
const user = await User.query().findById(id).throwIfNotFound();
await user.softRemove();
response.status(204).end();
};