diff options
Diffstat (limited to 'src/server/api/endpoints/app/show.ts')
| -rw-r--r-- | src/server/api/endpoints/app/show.ts | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/server/api/endpoints/app/show.ts b/src/server/api/endpoints/app/show.ts index 6668d0f243..072fbaeb79 100644 --- a/src/server/api/endpoints/app/show.ts +++ b/src/server/api/endpoints/app/show.ts @@ -9,21 +9,11 @@ export default (params: any, user: ILocalUser, app: IApp) => new Promise(async ( const isSecure = user != null && app == null; // Get 'appId' parameter - const [appId, appIdErr] = $.type(ID).optional.get(params.appId); + const [appId, appIdErr] = $.type(ID).get(params.appId); if (appIdErr) return rej('invalid appId param'); - // Get 'nameId' parameter - const [nameId, nameIdErr] = $.str.optional.get(params.nameId); - if (nameIdErr) return rej('invalid nameId param'); - - if (appId === undefined && nameId === undefined) { - return rej('appId or nameId is required'); - } - // Lookup app - const ap = appId !== undefined - ? await App.findOne({ _id: appId }) - : await App.findOne({ nameIdLower: nameId.toLowerCase() }); + const ap = await App.findOne({ _id: appId }); if (ap === null) { return rej('app not found'); |