Skip to content

Commit

Permalink
More robust response object
Browse files Browse the repository at this point in the history
  • Loading branch information
pratishta committed Dec 11, 2024
1 parent 73a65cb commit d8bb5ec
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/src/subscriber/subscriber.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,15 @@ export class SubscriberController {

if (userExistsInCurrentList && existingUserListConfirmed) {
response.status(201).send({
confirmed: true,
message: "User already subscribed."
})
return;
}

if (existingUserListConfirmed === 0) {
response.status(201).send({
confirmed: false,
message: "User is subscribed but must confirm."
})
return;
Expand Down

0 comments on commit d8bb5ec

Please sign in to comment.