Wrap location in data to conform with current API

Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
Johan Haals
2021-05-10 10:06:30 +02:00
parent b23de0aeb6
commit 6185b62e38
@@ -133,8 +133,8 @@ export async function createNextRouter(
res.status(201).json(output);
})
.get('/locations', async (_req, res) => {
const output = await locationService.listLocations();
res.status(200).json(output);
const locations = await locationService.listLocations();
res.status(200).json(locations.map(l => ({ data: l })));
})
.get('/locations/:id', async (req, res) => {