Skip to content

Commit

Permalink
[SIEM][CASE] Delete endpoints return noContent (elastic#61721)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas authored Mar 28, 2020
1 parent f7219cb commit 3eb842f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function initDeleteAllCommentsApi({ caseService, router, userActionServic
),
});

return response.ok({ body: 'true' });
return response.noContent();
} catch (error) {
return response.customError(wrapError(error));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('DELETE comment', () => {
beforeAll(async () => {
routeHandler = await createRoute(initDeleteCommentApi, 'delete');
});
it(`deletes the comment. responds with 200`, async () => {
it(`deletes the comment. responds with 204`, async () => {
const request = httpServerMock.createKibanaRequest({
path: '/api/cases/{case_id}/comments/{comment_id}',
method: 'delete',
Expand All @@ -39,7 +39,7 @@ describe('DELETE comment', () => {
);

const response = await routeHandler(theContext, request, kibanaResponseFactory);
expect(response.status).toEqual(200);
expect(response.status).toEqual(204);
});
it(`returns an error when thrown from deleteComment service`, async () => {
const request = httpServerMock.createKibanaRequest({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function initDeleteCommentApi({ caseService, router, userActionService }:
],
});

return response.ok({ body: 'true' });
return response.noContent();
} catch (error) {
return response.customError(wrapError(error));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('DELETE case', () => {
beforeAll(async () => {
routeHandler = await createRoute(initDeleteCasesApi, 'delete');
});
it(`deletes the case. responds with 200`, async () => {
it(`deletes the case. responds with 204`, async () => {
const request = httpServerMock.createKibanaRequest({
path: '/api/cases',
method: 'delete',
Expand All @@ -39,7 +39,7 @@ describe('DELETE case', () => {
);

const response = await routeHandler(theContext, request, kibanaResponseFactory);
expect(response.status).toEqual(200);
expect(response.status).toEqual(204);
});
it(`returns an error when thrown from deleteCase service`, async () => {
const request = httpServerMock.createKibanaRequest({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function initDeleteCasesApi({ caseService, router, userActionService }: R
),
});

return response.ok({ body: 'true' });
return response.noContent();
} catch (error) {
return response.customError(wrapError(error));
}
Expand Down

0 comments on commit 3eb842f

Please sign in to comment.