diff options
author | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-05-05 18:28:35 -0400 |
---|---|---|
committer | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-05-05 18:28:35 -0400 |
commit | 86f55d8aa12268fe847eaa344e8efbab5d293f34 (patch) | |
tree | 6bbc5c6fb6825ef969ed0342e4851667b81577cc /src/client/Network.ts | |
parent | 2a9db784a6e3492a8f7d8ce9a745b4f1a0494241 (diff) | |
parent | 139600ab7e8a82a31744cd3798247236cd5616fc (diff) |
Merge branch 'nathan-starter' of https://github.com/brown-dash/Dash-Web into nathan-starter
Diffstat (limited to 'src/client/Network.ts')
-rw-r--r-- | src/client/Network.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/client/Network.ts b/src/client/Network.ts index cdcd5225a..968c407b2 100644 --- a/src/client/Network.ts +++ b/src/client/Network.ts @@ -1,5 +1,6 @@ -import { Utils } from '../Utils'; import * as requestPromise from 'request-promise'; +import { ClientUtils } from '../ClientUtils'; +import { Utils } from '../Utils'; import { Upload } from '../server/SharedMediaTypes'; /** @@ -14,7 +15,7 @@ export namespace Networking { export async function PostToServer(relativeRoute: string, body?: any) { const options = { - uri: Utils.prepend(relativeRoute), + uri: ClientUtils.prepend(relativeRoute), method: 'POST', body, json: true, @@ -49,14 +50,14 @@ export namespace Networking { } const maxFileSize = 50000000; if (fileguidpairs.some(f => f.file.size > maxFileSize)) { - return new Promise<any>(res => + return new Promise<any>(res => { res([ { source: { name: '', type: '', size: 0, toJson: () => ({ name: '', type: '' }) }, result: { name: '', message: `max file size (${maxFileSize / 1000000}MB) exceeded` }, }, - ]) - ); + ]); + }); } formData.set('fileguids', fileguidpairs.map(pair => pair.guid).join(';')); formData.set('filesize', fileguidpairs.reduce((sum, pair) => sum + pair.file.size, 0).toString()); |