fix(xo-server/rest-api): handle ids that are numbers instead of strings

This commit is contained in:
Julien Fontanet
2023-06-30 18:12:38 +02:00
parent 650d88db46
commit db082bfbe9

View File

@@ -48,7 +48,7 @@ async function sendObjects(iterable, req, res, path = req.path) {
const { query } = req
const basePath = join(req.baseUrl, path)
const makeUrl = object => join(basePath, object.id)
const makeUrl = ({ id }) => join(basePath, typeof id === 'number' ? String(id) : id)
let makeResult
let { fields } = query