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');