diff options
| author | Johann150 <johann.galle@protonmail.com> | 2022-03-19 09:25:06 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-19 18:25:06 +0900 |
| commit | 255dc6334f5f1067991922ab9e422b209eefbd1a (patch) | |
| tree | acdf22a21485c34b5f219dd4cfcf5e41225b7e04 /packages/backend/src/server/api/endpoints | |
| parent | Fix: "Adding email to profile ends in error" (#8405) (diff) | |
| download | sharkey-255dc6334f5f1067991922ab9e422b209eefbd1a.tar.gz sharkey-255dc6334f5f1067991922ab9e422b209eefbd1a.tar.bz2 sharkey-255dc6334f5f1067991922ab9e422b209eefbd1a.zip | |
fix API console (#8416)
Adjusted the server to send the API description based on the new
API type declarations introduced previously.
Diffstat (limited to 'packages/backend/src/server/api/endpoints')
| -rw-r--r-- | packages/backend/src/server/api/endpoints/endpoint.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/backend/src/server/api/endpoints/endpoint.ts b/packages/backend/src/server/api/endpoints/endpoint.ts index 9db140183c..c174126779 100644 --- a/packages/backend/src/server/api/endpoints/endpoint.ts +++ b/packages/backend/src/server/api/endpoints/endpoint.ts @@ -20,9 +20,9 @@ export default define(meta, paramDef, async (ps) => { const ep = endpoints.find(x => x.name === ps.endpoint); if (ep == null) return null; return { - params: Object.entries(ep.meta.params || {}).map(([k, v]) => ({ + params: Object.entries(ep.params.properties || {}).map(([k, v]) => ({ name: k, - type: v.validator.name === 'ID' ? 'String' : v.validator.name, + type: v.type.charAt(0).toUpperCase() + v.type.slice(1), })), }; }); |