@overmap-ai/core 1.0.46-project-attachments.4 → 1.0.46-project-attachments.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3677,9 +3677,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3677
3677
|
if (action.payload.filter(onlyUniqueOfflineIds).length !== action.payload.length) {
|
|
3678
3678
|
throw new Error("Tried to use setIssues reducer with duplicate ID's");
|
|
3679
3679
|
}
|
|
3680
|
-
|
|
3681
|
-
state.documents[document2.offline_id] = document2;
|
|
3682
|
-
}
|
|
3680
|
+
state.documents = toOfflineIdRecord(action.payload);
|
|
3683
3681
|
},
|
|
3684
3682
|
addDocuments: (state, action) => {
|
|
3685
3683
|
for (const document2 of action.payload) {
|
|
@@ -4530,7 +4528,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4530
4528
|
const promise = this.enqueueRequest({
|
|
4531
4529
|
description: "Create attachment",
|
|
4532
4530
|
method: HttpMethod.POST,
|
|
4533
|
-
url: `/
|
|
4531
|
+
url: `/projects/${project}/attach/`,
|
|
4534
4532
|
blocks: [offline_id, project.toString()],
|
|
4535
4533
|
blockers: [file_sha1],
|
|
4536
4534
|
payload: {
|
|
@@ -4607,7 +4605,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4607
4605
|
return photoAttachmentPromise(file);
|
|
4608
4606
|
});
|
|
4609
4607
|
}
|
|
4610
|
-
|
|
4608
|
+
attachFilesToProject(filesToSubmit, projectId) {
|
|
4611
4609
|
return filesToSubmit.map((file) => {
|
|
4612
4610
|
if (!(file instanceof File)) {
|
|
4613
4611
|
throw new Error("Expected a File instance.");
|
|
@@ -7319,7 +7317,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7319
7317
|
blocks: [document2.offline_id]
|
|
7320
7318
|
});
|
|
7321
7319
|
promise.catch(() => {
|
|
7322
|
-
|
|
7320
|
+
updateDocuments([documentToBeUpdated]);
|
|
7323
7321
|
});
|
|
7324
7322
|
const fullDocument = store.getState().documentsReducer.documents[document2.offline_id];
|
|
7325
7323
|
return [fullDocument, promise];
|
|
@@ -7363,9 +7361,9 @@ var __publicField = (obj, key, value) => {
|
|
|
7363
7361
|
blocks: []
|
|
7364
7362
|
});
|
|
7365
7363
|
promise.then((result) => {
|
|
7366
|
-
|
|
7364
|
+
updateDocuments(result);
|
|
7367
7365
|
}).catch(() => {
|
|
7368
|
-
|
|
7366
|
+
updateDocuments(documentsToRevertIfMoveFails);
|
|
7369
7367
|
});
|
|
7370
7368
|
return promise;
|
|
7371
7369
|
}
|
|
@@ -7390,9 +7388,9 @@ var __publicField = (obj, key, value) => {
|
|
|
7390
7388
|
promise.then((documentsToUpdate) => {
|
|
7391
7389
|
store.dispatch(updateDocuments(documentsToUpdate));
|
|
7392
7390
|
}).catch(() => {
|
|
7393
|
-
store.dispatch(
|
|
7391
|
+
store.dispatch(updateDocuments([documentToBeDeleted]));
|
|
7394
7392
|
if (parentDocument) {
|
|
7395
|
-
store.dispatch(
|
|
7393
|
+
store.dispatch(updateDocuments([parentDocument]));
|
|
7396
7394
|
}
|
|
7397
7395
|
});
|
|
7398
7396
|
return promise;
|