@overmap-ai/core 1.0.62 → 1.0.63-form-submission-fix.0
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.
package/dist/overmap-core.js
CHANGED
|
@@ -5871,12 +5871,12 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5871
5871
|
throw new Error("Expected an active project");
|
|
5872
5872
|
}
|
|
5873
5873
|
const { values, files } = separateFilesFromValues(payload.values);
|
|
5874
|
-
const offlineSubmission = {
|
|
5874
|
+
const offlineSubmission = offline({
|
|
5875
5875
|
...payload,
|
|
5876
5876
|
values,
|
|
5877
5877
|
created_by: state.userReducer.currentUser.id,
|
|
5878
5878
|
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5879
|
-
};
|
|
5879
|
+
});
|
|
5880
5880
|
const promise = this.enqueueRequest({
|
|
5881
5881
|
description: "Respond to form",
|
|
5882
5882
|
method: HttpMethod.POST,
|
|
@@ -5885,7 +5885,7 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5885
5885
|
blockers: [payload.issue, payload.asset, payload.asset_stage, "add-form-entry"].filter(
|
|
5886
5886
|
(x) => x !== void 0
|
|
5887
5887
|
),
|
|
5888
|
-
blocks: [
|
|
5888
|
+
blocks: [offlineSubmission.offline_id]
|
|
5889
5889
|
});
|
|
5890
5890
|
const attachFilesPromises = this.getAttachFilesPromises(files, offlineSubmission);
|
|
5891
5891
|
this.dispatch(addFormSubmission(offlineSubmission));
|
|
@@ -5894,7 +5894,7 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
5894
5894
|
this.dispatch(setFormSubmission(result));
|
|
5895
5895
|
return result;
|
|
5896
5896
|
}).catch(() => {
|
|
5897
|
-
this.dispatch(deleteFormSubmission(
|
|
5897
|
+
this.dispatch(deleteFormSubmission(offlineSubmission.offline_id));
|
|
5898
5898
|
this.dispatch(addActiveProjectFormSubmissionsCount(-1));
|
|
5899
5899
|
});
|
|
5900
5900
|
const settledPromise = Promise.all([promise, ...attachFilesPromises]).then(() => promise);
|