Skip to content

Commit

Permalink
🖥️controllers | 🚧in progress: delete notification controller
Browse files Browse the repository at this point in the history
  • Loading branch information
0thigs committed Oct 25, 2024
1 parent 3d20f12 commit bed5ad7
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { IHttp } from "@stocker/core/interfaces";
import { DeleteNotificationUseCase } from "@stocker/core/use-cases";
import { notificationsRepository } from "@/database";

type RouteParams = {
notificationId: string
}

export class DeleteNotificationController {
async handle(http: IHttp) {
const { notificationId } = http.getBody<RouteParams>()
const useCase = new DeleteNotificationUseCase(notificationsRepository)
await useCase.execute({ notificationId })

return http.send(null, 204)
}
}

0 comments on commit bed5ad7

Please sign in to comment.