@open-tender/utils 0.1.154 → 0.1.155

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.
@@ -58,7 +58,12 @@ const useProfileForm = (profile, loading, error, update, callback, optionalField
58
58
  if (loading === 'idle') {
59
59
  setSubmitting(false);
60
60
  if (error) {
61
- setErrors((0, utils_1.makeFormErrors)(error));
61
+ const errs = (0, utils_1.makeFormErrors)(error);
62
+ if (errs.birth_date) {
63
+ errs.birth_date =
64
+ 'Invalid date. Please enter in mm/dd/yyyy format or leave blank.';
65
+ }
66
+ setErrors(errs);
62
67
  }
63
68
  else if (callback && submitting) {
64
69
  const payload = makePayload(fields, data);
@@ -101,7 +101,12 @@ const useSignUpForm = (loading, error, signUp, callback, checkConfig, hidePasswo
101
101
  if (loading === 'idle') {
102
102
  setSubmitting(false);
103
103
  if (error) {
104
- setErrors((0, utils_1.makeFormErrors)(error));
104
+ const errs = (0, utils_1.makeFormErrors)(error);
105
+ if (errs.birth_date) {
106
+ errs.birth_date =
107
+ 'Invalid date. Please enter in mm/dd/yyyy format or leave blank.';
108
+ }
109
+ setErrors(errs);
105
110
  }
106
111
  }
107
112
  }, [loading, error]);
@@ -55,7 +55,12 @@ export const useProfileForm = (profile, loading, error, update, callback, option
55
55
  if (loading === 'idle') {
56
56
  setSubmitting(false);
57
57
  if (error) {
58
- setErrors(makeFormErrors(error));
58
+ const errs = makeFormErrors(error);
59
+ if (errs.birth_date) {
60
+ errs.birth_date =
61
+ 'Invalid date. Please enter in mm/dd/yyyy format or leave blank.';
62
+ }
63
+ setErrors(errs);
59
64
  }
60
65
  else if (callback && submitting) {
61
66
  const payload = makePayload(fields, data);
@@ -98,7 +98,12 @@ export const useSignUpForm = (loading, error, signUp, callback, checkConfig, hid
98
98
  if (loading === 'idle') {
99
99
  setSubmitting(false);
100
100
  if (error) {
101
- setErrors(makeFormErrors(error));
101
+ const errs = makeFormErrors(error);
102
+ if (errs.birth_date) {
103
+ errs.birth_date =
104
+ 'Invalid date. Please enter in mm/dd/yyyy format or leave blank.';
105
+ }
106
+ setErrors(errs);
102
107
  }
103
108
  }
104
109
  }, [loading, error]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/utils",
3
- "version": "0.1.154",
3
+ "version": "0.1.155",
4
4
  "description": "A library of utils for use with Open Tender applications that utilize our cloud-based Order API.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",