diff --git a/src/platform/plugins/shared/dashboard/server/api/register_routes.ts b/src/platform/plugins/shared/dashboard/server/api/register_routes.ts index cce3d71bc9a2c..ea22de76f9525 100644 --- a/src/platform/plugins/shared/dashboard/server/api/register_routes.ts +++ b/src/platform/plugins/shared/dashboard/server/api/register_routes.ts @@ -187,8 +187,7 @@ export function registerAPIRoutes({ } return res.badRequest(e.message); } - - return res.created({ body: result }); + return res.ok({ body: result }); } ); diff --git a/src/platform/test/api_integration/apis/dashboards/update_dashboard/main.ts b/src/platform/test/api_integration/apis/dashboards/update_dashboard/main.ts index 1d8fc895e131d..8d2539b8809c3 100644 --- a/src/platform/test/api_integration/apis/dashboards/update_dashboard/main.ts +++ b/src/platform/test/api_integration/apis/dashboards/update_dashboard/main.ts @@ -41,14 +41,14 @@ const updatedDashboard = { export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertest'); describe('main', () => { - it('should return 201 with an updated dashboard', async () => { + it('should return 200 with an updated dashboard', async () => { const response = await supertest .put(`${PUBLIC_API_PATH}/be3733a0-9efe-11e7-acb3-3dab96693fab`) .set('kbn-xsrf', 'true') .set('ELASTIC_HTTP_VERSION_HEADER', '2023-10-31') .send(updatedDashboard); - expect(response.status).to.be(201); + expect(response.status).to.be(200); expect(response.body.item.id).to.be('be3733a0-9efe-11e7-acb3-3dab96693fab'); expect(response.body.item.type).to.be('dashboard'); @@ -88,7 +88,7 @@ export default function ({ getService }: FtrProviderContext) { }, }); - expect(response.status).to.be(201); + expect(response.status).to.be(200); expect(response.body.item.attributes.tags).to.contain('bar'); expect(response.body.item.attributes.tags).to.have.length(1); const referenceIds = response.body.item.references.map( @@ -112,7 +112,7 @@ export default function ({ getService }: FtrProviderContext) { }, }); - expect(response.status).to.be(201); + expect(response.status).to.be(200); expect(response.body.item.attributes.tags).to.contain('foo'); expect(response.body.item.attributes.tags).to.have.length(1); const referenceIds = response.body.item.references.map( @@ -136,7 +136,7 @@ export default function ({ getService }: FtrProviderContext) { }, }); - expect(response.status).to.be(201); + expect(response.status).to.be(200); expect(response.body.item.attributes).not.to.have.property('tags'); const referenceIds = response.body.item.references.map( (ref: SavedObjectReference) => ref.id @@ -159,7 +159,7 @@ export default function ({ getService }: FtrProviderContext) { }, }); - expect(response.status).to.be(201); + expect(response.status).to.be(200); expect(response.body.item.attributes.tags).to.contain('foo'); expect(response.body.item.attributes.tags).to.contain('bar'); expect(response.body.item.attributes.tags).to.contain('buzz');