feat: add delete notification
This commit is contained in:
parent
b4b7d633d1
commit
549410e9e3
1 changed files with 4 additions and 3 deletions
|
|
@ -17,6 +17,7 @@ import HttpStatus from "../interfaces/http-status";
|
|||
import prisma from "../db";
|
||||
import { Prisma } from "@prisma/client";
|
||||
import { queryOrNot } from "../utils/relation";
|
||||
import { notFoundError } from "../utils/error";
|
||||
|
||||
type NotificationCreate = {};
|
||||
type NotificationUpdate = {};
|
||||
|
|
@ -95,8 +96,8 @@ export class NotificationController extends Controller {
|
|||
@Delete("{notificationId}")
|
||||
@Security("keycloak")
|
||||
async deleteNotification(@Request() req: RequestWithUser, @Path() notificationId: string) {
|
||||
// TODO: implement
|
||||
|
||||
return {};
|
||||
const record = await prisma.notification.deleteMany({ where: { id: notificationId } });
|
||||
if (record.count === 0) throw notFoundError("Notification");
|
||||
return record;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue