@overmap-ai/core 1.0.71-fields.0 → 1.0.71-fields.1
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.
|
@@ -7383,6 +7383,61 @@ var __publicField = (obj, key, value) => {
|
|
|
7383
7383
|
this.dispatch(initializeFormSubmissionAttachments(result));
|
|
7384
7384
|
}
|
|
7385
7385
|
}
|
|
7386
|
+
class FormRevisionService extends BaseUploadService {
|
|
7387
|
+
add(payload) {
|
|
7388
|
+
var _a2;
|
|
7389
|
+
const { store } = this.client;
|
|
7390
|
+
const state = store.getState();
|
|
7391
|
+
const createdBy = (_a2 = state.userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
7392
|
+
const offlineFormRevision = offline({
|
|
7393
|
+
...payload,
|
|
7394
|
+
created_by: createdBy,
|
|
7395
|
+
revision: "Pending",
|
|
7396
|
+
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7397
|
+
});
|
|
7398
|
+
this.dispatch(addFormRevision(offlineFormRevision));
|
|
7399
|
+
const promise = this.enqueueRequest({
|
|
7400
|
+
description: "Create form revision",
|
|
7401
|
+
method: HttpMethod.POST,
|
|
7402
|
+
url: "/form-revisions/",
|
|
7403
|
+
payload: offlineFormRevision,
|
|
7404
|
+
blockers: [payload.form],
|
|
7405
|
+
blocks: [offlineFormRevision.offline_id]
|
|
7406
|
+
});
|
|
7407
|
+
void promise.then((result) => {
|
|
7408
|
+
this.dispatch(setFormRevision(result));
|
|
7409
|
+
}).catch(() => {
|
|
7410
|
+
this.dispatch(deleteFormRevision(offlineFormRevision.offline_id));
|
|
7411
|
+
});
|
|
7412
|
+
return [offlineFormRevision, promise];
|
|
7413
|
+
}
|
|
7414
|
+
async refreshStore(projectId, organizationId) {
|
|
7415
|
+
let formRevisions = [];
|
|
7416
|
+
const projectFormRevisions = await this.enqueueRequest({
|
|
7417
|
+
description: "Fetch project form revisions",
|
|
7418
|
+
method: HttpMethod.GET,
|
|
7419
|
+
url: "/form-revisions/",
|
|
7420
|
+
queryParams: {
|
|
7421
|
+
project: projectId.toString()
|
|
7422
|
+
},
|
|
7423
|
+
blockers: [projectId.toString()],
|
|
7424
|
+
blocks: []
|
|
7425
|
+
});
|
|
7426
|
+
formRevisions = formRevisions.concat(projectFormRevisions);
|
|
7427
|
+
const organizationFormRevisions = await this.enqueueRequest({
|
|
7428
|
+
description: "Fetch organization form revisions",
|
|
7429
|
+
method: HttpMethod.GET,
|
|
7430
|
+
url: "/form-revisions/",
|
|
7431
|
+
queryParams: {
|
|
7432
|
+
organization: organizationId.toString()
|
|
7433
|
+
},
|
|
7434
|
+
blockers: [organizationId.toString()],
|
|
7435
|
+
blocks: []
|
|
7436
|
+
});
|
|
7437
|
+
formRevisions = formRevisions.concat(organizationFormRevisions);
|
|
7438
|
+
this.dispatch(initializeFormRevisions(formRevisions));
|
|
7439
|
+
}
|
|
7440
|
+
}
|
|
7386
7441
|
class AssetTypeFieldsAttachmentService extends BaseUploadService {
|
|
7387
7442
|
async bulkAdd(payloads) {
|
|
7388
7443
|
var _a2;
|
|
@@ -8080,6 +8135,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8080
8135
|
exports2.EmailVerificationService = EmailVerificationService;
|
|
8081
8136
|
exports2.FileService = FileService;
|
|
8082
8137
|
exports2.FormRevisionAttachmentService = FormRevisionAttachmentService;
|
|
8138
|
+
exports2.FormRevisionService = FormRevisionService;
|
|
8083
8139
|
exports2.FormService = FormService;
|
|
8084
8140
|
exports2.FormSubmissionAttachmentService = FormSubmissionAttachmentService;
|
|
8085
8141
|
exports2.FormSubmissionService = FormSubmissionService;
|