aboutsummaryrefslogtreecommitdiff
path: root/src/client/Network.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-07-05 10:15:54 -0400
committerbobzel <zzzman@gmail.com>2022-07-05 10:15:54 -0400
commitc1cd00c7664df694b867f4989a1f61d959390742 (patch)
tree29cfd0a7f9ed26ce2fd2eaf90549232e6c999c9d /src/client/Network.ts
parent2917042be6dc9d05a1a6a8d9dd01d19f915f1b68 (diff)
parent3419d46a569da7ae8899588251426b82996ca523 (diff)
Merge branch 'master' into parker
Diffstat (limited to 'src/client/Network.ts')
-rw-r--r--src/client/Network.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/client/Network.ts b/src/client/Network.ts
index 3597e7b2b..c781d4b6b 100644
--- a/src/client/Network.ts
+++ b/src/client/Network.ts
@@ -18,6 +18,13 @@ export namespace Networking {
return requestPromise.post(options);
}
+ /**
+ * Handles uploading basic file types to server and makes the API call to "/uploadFormData" endpoint
+ * with the mapping of GUID to filem as parameters.
+ *
+ * @param files the files to be uploaded to the server
+ * @returns the response as a json from the server
+ */
export async function UploadFilesToServer<T extends Upload.FileInformation = Upload.FileInformation>(files: File | File[]): Promise<Upload.FileResponse<T>[]> {
const formData = new FormData();
if (Array.isArray(files)) {
@@ -35,7 +42,7 @@ export namespace Networking {
const response = await fetch("/uploadFormData", parameters);
return response.json();
}
-
+
export async function UploadYoutubeToServer<T extends Upload.FileInformation = Upload.FileInformation>(videoId: string): Promise<Upload.FileResponse<T>[]> {
const parameters = {
method: 'POST',
@@ -45,5 +52,6 @@ export namespace Networking {
const response = await fetch("/uploadYoutubeVideo", parameters);
return response.json();
}
+
} \ No newline at end of file