Skip to content

Commit

Permalink
fix(xo-server/rest-api): handle ids that are numbers instead of strings
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-f committed Jun 30, 2023
1 parent 650d88d commit db082bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/xo-server/src/xo-mixins/rest-api.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit db082bf

Please sign in to comment.