@overmap-ai/core 1.0.38-component-fields.22 → 1.0.38-component-fields.24

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.
@@ -5763,10 +5763,12 @@ class UserFormSubmissionService extends BaseApiService {
5763
5763
  blocks: [payload.offline_id]
5764
5764
  });
5765
5765
  const attachFilesPromises = this.getAttachFilesPromises(files, payload);
5766
+ const now = (/* @__PURE__ */ new Date()).toISOString();
5766
5767
  const fullOfflineResult = {
5767
5768
  ...payload,
5768
5769
  created_by: state.userReducer.currentUser.id,
5769
- created_at: (/* @__PURE__ */ new Date()).toISOString()
5770
+ created_at: now,
5771
+ updated_at: now
5770
5772
  };
5771
5773
  const offlineResultWithoutFiles = {
5772
5774
  ...fullOfflineResult,
@@ -5789,16 +5791,18 @@ class UserFormSubmissionService extends BaseApiService {
5789
5791
  throw new Error("Expected payloadWithoutFiles to have created_by and created_at fields.");
5790
5792
  }
5791
5793
  const attachFilesPromises = this.getAttachFilesPromises(files, submission);
5792
- store.dispatch(updateOrCreateUserFormSubmission(payloadWithoutFiles));
5794
+ const fullResult = {
5795
+ ...payloadWithoutFiles,
5796
+ updated_at: (/* @__PURE__ */ new Date()).toISOString()
5797
+ };
5798
+ store.dispatch(updateOrCreateUserFormSubmission(fullResult));
5793
5799
  const promise = this.enqueueRequest({
5794
5800
  description: "Patch form submission",
5795
5801
  method: HttpMethod.PATCH,
5796
5802
  url: `/forms/submissions/${submission.offline_id}/`,
5797
- payload: payloadWithoutFiles,
5798
- blockers: [payloadWithoutFiles.issue, payloadWithoutFiles.component].filter(
5799
- (x) => x !== void 0
5800
- ),
5801
- blocks: [payloadWithoutFiles.offline_id]
5803
+ payload: fullResult,
5804
+ blockers: [fullResult.issue, fullResult.component].filter((x) => x !== void 0),
5805
+ blocks: [fullResult.offline_id]
5802
5806
  });
5803
5807
  return Promise.all([promise, ...attachFilesPromises]).then(() => promise);
5804
5808
  }
@@ -10349,6 +10353,7 @@ const FormRenderer = memo(
10349
10353
  } = props;
10350
10354
  const { readonly } = schema.meta;
10351
10355
  const formId2 = useMemo(() => crypto.randomUUID(), []);
10356
+ console.log(initialFormValues(schema.fields, values));
10352
10357
  const formik = useFormik({
10353
10358
  initialValues: initialFormValues(schema.fields, values),
10354
10359
  onSubmit,