From 9d2d5d16f3ff16c45ebe44202d2ac5290a4070da Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 16 Feb 2022 10:08:57 -0800 Subject: [PATCH] return 200 for immediate setters which require no further processing --- src/routes/branding.js | 6 +++--- src/routes/test/branding-test.js | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/routes/branding.js b/src/routes/branding.js index ebb017556..b81be730c 100644 --- a/src/routes/branding.js +++ b/src/routes/branding.js @@ -41,7 +41,7 @@ async function setCloudronName(req, res, next) { const [error] = await safe(settings.setCloudronName(req.body.name)); if (error) return next(BoxError.toHttpError(error)); - next(new HttpSuccess(202, {})); + next(new HttpSuccess(200, {})); } async function getCloudronName(req, res, next) { @@ -72,7 +72,7 @@ async function setAppstoreListingConfig(req, res, next) { const [error] = await safe(settings.setAppstoreListingConfig(listingConfig)); if (error) return next(BoxError.toHttpError(error)); - next(new HttpSuccess(202, {})); + next(new HttpSuccess(200, {})); } async function getAppstoreListingConfig(req, res, next) { @@ -92,7 +92,7 @@ async function setCloudronAvatar(req, res, next) { const [error] = await safe(settings.setCloudronAvatar(avatar)); if (error) return next(BoxError.toHttpError(error)); - next(new HttpSuccess(202, {})); + next(new HttpSuccess(200, {})); } async function getCloudronAvatar(req, res, next) { diff --git a/src/routes/test/branding-test.js b/src/routes/test/branding-test.js index 8312ea352..d56a560b4 100644 --- a/src/routes/test/branding-test.js +++ b/src/routes/test/branding-test.js @@ -51,7 +51,7 @@ describe('Branding API', function () { .query({ access_token: owner.token }) .send({ name: name }); - expect(response.statusCode).to.equal(202); + expect(response.statusCode).to.equal(200); }); it('get succeeds', async function () { @@ -85,7 +85,7 @@ describe('Branding API', function () { .query({ access_token: owner.token }) .attach('avatar', paths.CLOUDRON_DEFAULT_AVATAR_FILE); - expect(response.statusCode).to.equal(202); + expect(response.statusCode).to.equal(200); }); it('get succeeds', async function () { @@ -138,7 +138,7 @@ describe('Branding API', function () { .query({ access_token: owner.token }) .send({ blacklist: [ 'id1', 'id2' ] }); - expect(response.statusCode).to.equal(202); + expect(response.statusCode).to.equal(200); }); it('get bl succeeds', async function () { @@ -155,7 +155,7 @@ describe('Branding API', function () { .query({ access_token: owner.token }) .send({ whitelist: [ 'id1', 'id2' ] }); - expect(response.statusCode).to.equal(202); + expect(response.statusCode).to.equal(200); }); it('get wl succeeds', async function () {