diff options
| author | PRB0t <34620110+PRB0t@users.noreply.github.com> | 2018-07-13 16:17:02 +0200 |
|---|---|---|
| committer | PRB0t <34620110+PRB0t@users.noreply.github.com> | 2018-07-13 16:17:02 +0200 |
| commit | 0e7fe670aa9b66d9e5a5a297c28c10dec1d86129 (patch) | |
| tree | 7904245e443ab3f67e55575e634e1e00577191c4 /src/server/api/call.ts | |
| parent | Merge pull request #1891 from syuilo/greenkeeper/html-minifier-3.5.19 (diff) | |
| download | sharkey-0e7fe670aa9b66d9e5a5a297c28c10dec1d86129.tar.gz sharkey-0e7fe670aa9b66d9e5a5a297c28c10dec1d86129.tar.bz2 sharkey-0e7fe670aa9b66d9e5a5a297c28c10dec1d86129.zip | |
🤖 Fix a bug
Diffstat (limited to 'src/server/api/call.ts')
| -rw-r--r-- | src/server/api/call.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server/api/call.ts b/src/server/api/call.ts index 2b00f5df0a..255ae61ad6 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<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'); |