Restore 200 OK + response payload for save and delete endpoints (#55535)

This commit is contained in:
Jean-Louis Leysens 2020-01-22 13:52:53 +01:00 committed by GitHub
parent e828a12954
commit d23d8f0afd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -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)) {

View file

@ -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)) {