Skip to content

Commit

Permalink
Restore 200 OK + response payload for save and delete endpoints (#55535)
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens authored Jan 22, 2020
1 parent e828a12 commit d23d8f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ export function registerDeleteRoute(deps: RouteDependencies, legacy: ServerShim)
const { watchId } = request.params;

try {
await deleteWatch(callWithRequest, watchId);
return response.noContent();
return response.ok({
body: await deleteWatch(callWithRequest, watchId),
});
} catch (e) {
// Case: Error from Elasticsearch JS client
if (isEsError(e)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ export function registerSaveRoute(deps: RouteDependencies, legacy: ServerShim) {

try {
// Create new watch
await saveWatch(callWithRequest, id, serializedWatch);
return response.noContent();
return response.ok({
body: await saveWatch(callWithRequest, id, serializedWatch),
});
} catch (e) {
// Case: Error from Elasticsearch JS client
if (isEsError(e)) {
Expand Down

0 comments on commit d23d8f0

Please sign in to comment.