Skip to content

Commit

Permalink
refactor: removed useless nested fold
Browse files Browse the repository at this point in the history
  • Loading branch information
LeleDallas committed Oct 30, 2024
1 parent 3c35192 commit f73e324
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/features/payments/routers/notices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,10 @@ addNoticesHandler("post", "/paids/:eventId/disable", (req, res) => {
O.fromNullable,
O.fold(
() => res.sendStatus(400),
eventId =>
pipe(
O.fromNullable(NoticesDB.removeUserNotice(eventId)),
O.fold(
() => res.sendStatus(hideReceiptResponseCode),
() => res.sendStatus(hideReceiptResponseCode)
)
)
eventId => {
NoticesDB.removeUserNotice(eventId);
return res.sendStatus(hideReceiptResponseCode);
}
)
);
});

0 comments on commit f73e324

Please sign in to comment.