Skip to content

Commit

Permalink
Controller should return 204, not 201
Browse files Browse the repository at this point in the history
  • Loading branch information
iamleeg committed Jul 8, 2021
1 parent 8530f39 commit 999e0a1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions verification/curator-service/api/src/controllers/sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ export default class SourcesController {
req.params.id
}&email=${encodeURIComponent(user.email)}`,
);
if (response.status == 201) {
res.sendStatus(201).end();
if (response.status == 204) {
res.sendStatus(204).end();
} else {
res.status(response.status).json(response.data);
}
Expand All @@ -321,8 +321,8 @@ export default class SourcesController {
const response = await axios.post(
`${this.dataServerURL}/api/cases/removePendingCases?sourceId=${req.params.id}`,
);
if (response.status == 201) {
res.sendStatus(201).end();
if (response.status == 204) {
res.sendStatus(204).end();
} else {
res.status(response.status).json(response.data);
}
Expand Down Expand Up @@ -354,8 +354,8 @@ export default class SourcesController {
req.params.id
}&email=${encodeURIComponent(user.email)}`,
);
if (response.status == 201) {
res.sendStatus(201).end();
if (response.status == 204) {
res.sendStatus(204).end();
} else {
res.status(response.status).json(response.data);
}
Expand Down

0 comments on commit 999e0a1

Please sign in to comment.