Skip to content

Commit

Permalink
refactor: change code style
Browse files Browse the repository at this point in the history
  • Loading branch information
DLBrianPina committed Sep 3, 2021
1 parent b2a7fa8 commit a7c52c6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/services/HelpService.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,15 @@ class HelpService {
saveError(err);
}
help.status = "finished";
} else if (help.status === "owner_finished") {
throw new BadRequestError("Usuário já confirmou a finalização da ajuda");
} else if (help.status === "finished") {
throw new BadRequestError("Essa ajuda já foi finalizada");
} else {
help.status = "owner_finished";
switch (help.status) {
case "owner_finished":
throw new BadRequestError("Usuário já confirmou a finalização da ajuda");
case "finished":
throw new BadRequestError("Essa ajuda já foi finalizada");
default:
help.status = "owner_finished";
}
}
await this.HelpRepository.update(help);
}
Expand Down

0 comments on commit a7c52c6

Please sign in to comment.