Skip to content

Commit 4d5cd1d

Browse files
authored
Restore 200 OK + response payload for save and delete endpoints (#55535) (#55542)
1 parent fe957e7 commit 4d5cd1d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

x-pack/legacy/plugins/watcher/server/np_ready/routes/api/watch/register_delete_route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ export function registerDeleteRoute(deps: RouteDependencies, legacy: ServerShim)
2424
const { watchId } = request.params;
2525

2626
try {
27-
await deleteWatch(callWithRequest, watchId);
28-
return response.noContent();
27+
return response.ok({
28+
body: await deleteWatch(callWithRequest, watchId),
29+
});
2930
} catch (e) {
3031
// Case: Error from Elasticsearch JS client
3132
if (isEsError(e)) {

x-pack/legacy/plugins/watcher/server/np_ready/routes/api/watch/register_save_route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ export function registerSaveRoute(deps: RouteDependencies, legacy: ServerShim) {
7676

7777
try {
7878
// Create new watch
79-
await saveWatch(callWithRequest, id, serializedWatch);
80-
return response.noContent();
79+
return response.ok({
80+
body: await saveWatch(callWithRequest, id, serializedWatch),
81+
});
8182
} catch (e) {
8283
// Case: Error from Elasticsearch JS client
8384
if (isEsError(e)) {

0 commit comments

Comments
 (0)