From 999e0a1b68e42e81533bef3ba53dd20830d266cd Mon Sep 17 00:00:00 2001 From: Graham Lee Date: Thu, 8 Jul 2021 15:07:58 +0100 Subject: [PATCH] Controller should return 204, not 201 --- .../curator-service/api/src/controllers/sources.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/verification/curator-service/api/src/controllers/sources.ts b/verification/curator-service/api/src/controllers/sources.ts index b7c6f8710..f1c6e6b79 100644 --- a/verification/curator-service/api/src/controllers/sources.ts +++ b/verification/curator-service/api/src/controllers/sources.ts @@ -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); } @@ -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); } @@ -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); }