aboutsummaryrefslogtreecommitdiff
path: root/src/client/Network.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-05-14 23:15:24 -0400
committerbobzel <zzzman@gmail.com>2024-05-14 23:15:24 -0400
commit3534aaf88a3c30a474b3b5a5b7f04adfe6f15fac (patch)
tree47fb7a8671b209bd4d76e0f755a5b035c6936607 /src/client/Network.ts
parent87bca251d87b5a95da06b2212400ce9427152193 (diff)
parent5cb7ad90e120123ca572e8ef5b1aa6ca41581134 (diff)
Merge branch 'restoringEslint' into sarah-ai-visualization
Diffstat (limited to 'src/client/Network.ts')
-rw-r--r--src/client/Network.ts11
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());