diff options
| author | James Hu <51237606+jameshu111@users.noreply.github.com> | 2023-06-07 11:45:20 -0400 |
|---|---|---|
| committer | James Hu <51237606+jameshu111@users.noreply.github.com> | 2023-06-07 11:45:20 -0400 |
| commit | 55502b8d24dbbad87af5b9059cc3a746e4db91d9 (patch) | |
| tree | f89db45a778bffd1f74f746b8fbc46b8bb1e1000 /src/client/documents | |
| parent | 3d30bdaf6dcf4972593f10b9b0f2fabd79c7062b (diff) | |
logging
Diffstat (limited to 'src/client/documents')
| -rw-r--r-- | src/client/documents/Documents.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 515a870b5..75998ac40 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -2,7 +2,7 @@ import { IconProp } from '@fortawesome/fontawesome-svg-core'; import { action, runInAction } from 'mobx'; import { basename } from 'path'; import { DateField } from '../../fields/DateField'; -import { Doc, DocListCast, Field, Initializing, Opt, updateCachedAcls } from '../../fields/Doc'; +import { DataSym, Doc, DocListCast, Field, FieldsSym, Initializing, Opt, updateCachedAcls } from '../../fields/Doc'; import { Id } from '../../fields/FieldSymbols'; import { HtmlField } from '../../fields/HtmlField'; import { InkField, PointData } from '../../fields/InkField'; @@ -1843,7 +1843,9 @@ export namespace DocUtils { export async function uploadFilesToDocs(files: File[], options: DocumentOptions) { const generatedDocuments: Doc[] = []; - const upfiles = await Networking.UploadFilesToServer(files); + const fileNoGuidPairs: Networking.FileGuidPair[] = []; + files.map(file => fileNoGuidPairs.push({file : file})); + const upfiles = await Networking.UploadFilesToServer(fileNoGuidPairs); for (const { source: { name, type }, result, @@ -1855,7 +1857,7 @@ export namespace DocUtils { export function uploadFileToDoc(file: File, options: DocumentOptions, overwriteDoc: Doc) { const generatedDocuments: Doc[] = []; - Networking.UploadFilesToServer([file]).then(upfiles => { + Networking.UploadFilesToServer([{file: file, guid: overwriteDoc[Id]}]).then(upfiles => { const { source: { name, type }, result, |
