fix API console (#8416)

Adjusted the server to send the API description based on the new
API type declarations introduced previously.
This commit is contained in:
Johann150 2022-03-19 09:25:06 +00:00 committed by GitHub
parent c0bf7cd871
commit 255dc6334f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -20,9 +20,9 @@ export default define(meta, paramDef, async (ps) => {
const ep = endpoints.find(x => x.name === ps.endpoint); const ep = endpoints.find(x => x.name === ps.endpoint);
if (ep == null) return null; if (ep == null) return null;
return { return {
params: Object.entries(ep.meta.params || {}).map(([k, v]) => ({ params: Object.entries(ep.params.properties || {}).map(([k, v]) => ({
name: k, name: k,
type: v.validator.name === 'ID' ? 'String' : v.validator.name, type: v.type.charAt(0).toUpperCase() + v.type.slice(1),
})), })),
}; };
}); });