1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-01 08:18:45 +09:00

🤖 Fix a bug

This commit is contained in:
PRB0t 2018-07-13 16:17:02 +02:00
parent b984aecaf2
commit 0e7fe670aa

View File

@ -6,7 +6,8 @@ import { IApp } from '../../models/app';
export default (endpoint: string | Endpoint, user: IUser, app: IApp, data: any, file?: any) => new Promise<any>(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');