Skip to content

Commit

Permalink
fix extend return value
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkime committed Jun 16, 2023
1 parent c8fd651 commit af2f548
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/plugins/data/server/search/routes/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,16 +302,26 @@ export function registerSessionRoutes(router: DataPluginRouter, logger: Logger):
expires: schema.string(),
}),
},
response: {
200: {
body: searchSessionsUpdateSchema,
},
},
},
},
async (context, request, res) => {
const { id } = request.params;
const { expires } = request.body;
try {
const searchContext = await context.search;
await searchContext.extendSession(id, new Date(expires));
const response: SearchSessionsUpdateRestResponse = await searchContext.extendSession(
id,
new Date(expires)
);

return res.ok();
return res.ok({
body: response,
});
} catch (e) {
const err = e.output?.payload || e;
logger.error(err);
Expand Down

0 comments on commit af2f548

Please sign in to comment.