[API] Fix bug
This commit is contained in:
parent
66eed481ea
commit
3a58cff9b2
4 changed files with 11 additions and 11 deletions
|
|
@ -57,12 +57,12 @@ module.exports = (params, user, _, isSecure) =>
|
|||
const [nameId, nameIdErr] = it(params.name_id, 'string');
|
||||
if (nameIdErr) return rej('invalid name_id param');
|
||||
|
||||
if (appId === null && nameId === null) {
|
||||
if (appId === undefined && nameId === undefined) {
|
||||
return rej('app_id or name_id is required');
|
||||
}
|
||||
|
||||
// Lookup app
|
||||
const app = appId !== null
|
||||
const app = appId !== undefined
|
||||
? await App.findOne({ _id: appId })
|
||||
: await App.findOne({ name_id_lower: nameId.toLowerCase() });
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue