Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SIEM][CASE] Delete endpoints return noContent #61721

Merged
merged 1 commit into from
Mar 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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