@appcorp/stellar-solutions-invoice-module 0.1.11 → 0.1.12
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/base-modules/invoice/context.js +20 -19
- package/package.json +1 -1
|
@@ -99,7 +99,6 @@ var actions_1 = require("./actions");
|
|
|
99
99
|
var constants_1 = require("./constants");
|
|
100
100
|
var reducer_1 = require("./reducer");
|
|
101
101
|
var types_1 = require("./types");
|
|
102
|
-
var validate_1 = require("./validate");
|
|
103
102
|
var generate_toast_1 = require("@appcorp/app-corp-vista/utils/generate-toast");
|
|
104
103
|
var calculate_subtotal_1 = require("./calculate-subtotal");
|
|
105
104
|
var context_1 = require("@appcorp/stellar-solutions-product-module/base-modules/product/context");
|
|
@@ -349,29 +348,31 @@ var useInvoiceState = function () {
|
|
|
349
348
|
// return urls;
|
|
350
349
|
// }, [state.images]);
|
|
351
350
|
var handleSubmit = (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
352
|
-
var validationResult, validationErrors_1;
|
|
353
351
|
return __generator(this, function (_a) {
|
|
354
352
|
dispatch({
|
|
355
353
|
type: actions_1.INVOICE_ACTION_TYPES.SET_DISABLE_SAVE_BUTTON,
|
|
356
354
|
payload: { disableSaveButton: true },
|
|
357
355
|
});
|
|
358
356
|
try {
|
|
359
|
-
validationResult =
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
357
|
+
// const validationResult =
|
|
358
|
+
// formValidation?.safeParse({
|
|
359
|
+
// ...updatedParams,
|
|
360
|
+
// });
|
|
361
|
+
// if (validationResult?.error) {
|
|
362
|
+
// const validationErrors: Record<string, string> = {};
|
|
363
|
+
// validationResult?.error.errors.forEach((err) => {
|
|
364
|
+
// validationErrors[err.path[0]] = err.message;
|
|
365
|
+
// });
|
|
366
|
+
// dispatch({
|
|
367
|
+
// type: INVOICE_ACTION_TYPES.SET_ERRORS,
|
|
368
|
+
// payload: validationErrors,
|
|
369
|
+
// });
|
|
370
|
+
// }
|
|
371
|
+
// if (validationResult?.success) {
|
|
372
|
+
updateFetchNow(undefined, {
|
|
373
|
+
body: JSON.stringify(__assign({}, updatedParams)),
|
|
374
|
+
});
|
|
375
|
+
// }
|
|
375
376
|
}
|
|
376
377
|
catch (_b) {
|
|
377
378
|
(0, generate_toast_1.generateToast)({
|
|
@@ -387,7 +388,7 @@ var useInvoiceState = function () {
|
|
|
387
388
|
});
|
|
388
389
|
return [2 /*return*/];
|
|
389
390
|
});
|
|
390
|
-
}); }, [updateFetchNow]);
|
|
391
|
+
}); }, [updateFetchNow, updatedParams]);
|
|
391
392
|
var handleChange = (0, react_1.useCallback)(function (key, value) {
|
|
392
393
|
if (key === 'taxValue') {
|
|
393
394
|
dispatch({
|