Hi team, can you help me please to get space on the server side? I need to do smth like to get data based on space.
router.get(
{
path: '/api/get_data',
validate: false,
},
async (context, req, response) => {
const space = someFunctionThatHelpsToGetSpaceOnServerSide()
const result = await context.core.elasticsearch.client.asCurrentUser.search({
index: space + "management-data"
})
return response.ok({
body: result
})
}
);