From bb7b335491e97a071efa4dc119cee8c9fcc9dd88 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 19 Aug 2018 18:38:02 +0900 Subject: nameId廃止 & アプリ作成時にシークレットを返すように MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/api/endpoints/app/show.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/server/api/endpoints/app/show.ts') 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'); -- cgit v1.2.3-freya