return 200 for immediate setters which require no further processing

This commit is contained in:
Girish Ramakrishnan
2022-02-16 10:08:57 -08:00
parent 9dbb299bb9
commit 9d2d5d16f3
2 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -41,7 +41,7 @@ async function setCloudronName(req, res, next) {
const [error] = await safe(settings.setCloudronName(req.body.name)); const [error] = await safe(settings.setCloudronName(req.body.name));
if (error) return next(BoxError.toHttpError(error)); if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(202, {})); next(new HttpSuccess(200, {}));
} }
async function getCloudronName(req, res, next) { async function getCloudronName(req, res, next) {
@@ -72,7 +72,7 @@ async function setAppstoreListingConfig(req, res, next) {
const [error] = await safe(settings.setAppstoreListingConfig(listingConfig)); const [error] = await safe(settings.setAppstoreListingConfig(listingConfig));
if (error) return next(BoxError.toHttpError(error)); if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(202, {})); next(new HttpSuccess(200, {}));
} }
async function getAppstoreListingConfig(req, res, next) { async function getAppstoreListingConfig(req, res, next) {
@@ -92,7 +92,7 @@ async function setCloudronAvatar(req, res, next) {
const [error] = await safe(settings.setCloudronAvatar(avatar)); const [error] = await safe(settings.setCloudronAvatar(avatar));
if (error) return next(BoxError.toHttpError(error)); if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(202, {})); next(new HttpSuccess(200, {}));
} }
async function getCloudronAvatar(req, res, next) { async function getCloudronAvatar(req, res, next) {
+4 -4
View File
@@ -51,7 +51,7 @@ describe('Branding API', function () {
.query({ access_token: owner.token }) .query({ access_token: owner.token })
.send({ name: name }); .send({ name: name });
expect(response.statusCode).to.equal(202); expect(response.statusCode).to.equal(200);
}); });
it('get succeeds', async function () { it('get succeeds', async function () {
@@ -85,7 +85,7 @@ describe('Branding API', function () {
.query({ access_token: owner.token }) .query({ access_token: owner.token })
.attach('avatar', paths.CLOUDRON_DEFAULT_AVATAR_FILE); .attach('avatar', paths.CLOUDRON_DEFAULT_AVATAR_FILE);
expect(response.statusCode).to.equal(202); expect(response.statusCode).to.equal(200);
}); });
it('get succeeds', async function () { it('get succeeds', async function () {
@@ -138,7 +138,7 @@ describe('Branding API', function () {
.query({ access_token: owner.token }) .query({ access_token: owner.token })
.send({ blacklist: [ 'id1', 'id2' ] }); .send({ blacklist: [ 'id1', 'id2' ] });
expect(response.statusCode).to.equal(202); expect(response.statusCode).to.equal(200);
}); });
it('get bl succeeds', async function () { it('get bl succeeds', async function () {
@@ -155,7 +155,7 @@ describe('Branding API', function () {
.query({ access_token: owner.token }) .query({ access_token: owner.token })
.send({ whitelist: [ 'id1', 'id2' ] }); .send({ whitelist: [ 'id1', 'id2' ] });
expect(response.statusCode).to.equal(202); expect(response.statusCode).to.equal(200);
}); });
it('get wl succeeds', async function () { it('get wl succeeds', async function () {