From 0e7fe670aa9b66d9e5a5a297c28c10dec1d86129 Mon Sep 17 00:00:00 2001 From: PRB0t <34620110+PRB0t@users.noreply.github.com> Date: Fri, 13 Jul 2018 16:17:02 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Fix=20a=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/api/call.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/api/call.ts b/src/server/api/call.ts index 2b00f5df0..255ae61ad 100644 --- a/src/server/api/call.ts +++ b/src/server/api/call.ts @@ -6,7 +6,8 @@ import { IApp } from '../../models/app'; export default (endpoint: string | Endpoint, user: IUser, app: IApp, data: any, file?: any) => new Promise(async (ok, rej) => { const isSecure = user != null && app == null; - const ep = typeof endpoint == 'string' ? endpoints.find(e => e.name == endpoint) : endpoint; + const epName = typeof endpoint === 'string' ? endpoint : endpoint.name; + const ep = endpoints.find(e => e.name === epName); if (ep.name.includes('.')) { return rej('INVALID_ENDPOINT');