added notification

master
alex 2024-01-25 23:31:41 +01:00
parent 719a956ad4
commit b6fc2a87f5
2 changed files with 48 additions and 6 deletions

View File

@ -545,7 +545,16 @@ function ModalAddEditService({
fetchServices(); fetchServices();
}) })
.catch((errStatus) => { .catch((errStatus) => {
console.log(errStatus); setIsRequesting(false);
if (errStatus === 400) {
notificationApi["error"]({
message: t("common.request.inputsInvalid.title"),
description: t(
"common.request.inputsInvalid.description"
),
});
}
}); });
}) })
.catch(() => .catch(() =>
@ -590,7 +599,16 @@ function ModalAddEditService({
fetchServices(); fetchServices();
}) })
.catch((errStatus) => { .catch((errStatus) => {
console.log(errStatus); setIsRequesting(false);
if (errStatus === 400) {
notificationApi["error"]({
message: t("common.request.inputsInvalid.title"),
description: t(
"common.request.inputsInvalid.description"
),
});
}
}); });
}) })
.catch(() => .catch(() =>
@ -725,7 +743,16 @@ function ModalAddEditServiceActivity({
fetchServices(); fetchServices();
}) })
.catch((errStatus) => { .catch((errStatus) => {
console.log(errStatus); setIsRequesting(false);
if (errStatus === 400) {
notificationApi["error"]({
message: t("common.request.inputsInvalid.title"),
description: t(
"common.request.inputsInvalid.description"
),
});
}
}); });
}) })
.catch(() => .catch(() =>
@ -831,7 +858,16 @@ function ModalAddEditServiceActivity({
fetchServices(); fetchServices();
}) })
.catch((errStatus) => { .catch((errStatus) => {
console.log(errStatus); setIsRequesting(false);
if (errStatus === 400) {
notificationApi["error"]({
message: t("common.request.inputsInvalid.title"),
description: t(
"common.request.inputsInvalid.description"
),
});
}
}); });
}) })
.catch(() => .catch(() =>
@ -886,6 +922,9 @@ function ServiceNameFormInput({ formItemName }) {
return ( return (
<MyFormInput <MyFormInput
formItemName={formItemName} formItemName={formItemName}
propsInput={{
showCount: true,
}}
minLength={Constants.GLOBALS.MIN_STORE_SERVICE_NAME_LENGTH} minLength={Constants.GLOBALS.MIN_STORE_SERVICE_NAME_LENGTH}
maxLength={Constants.GLOBALS.MAX_STORE_SERVICE_NAME_LENGTH} maxLength={Constants.GLOBALS.MAX_STORE_SERVICE_NAME_LENGTH}
label={t("storeServices.serviceName")} label={t("storeServices.serviceName")}
@ -909,6 +948,9 @@ function ServiceActivityNameFormInput({ formItemName }) {
return ( return (
<MyFormInput <MyFormInput
formItemName={formItemName} formItemName={formItemName}
propsInput={{
showCount: true,
}}
minLength={Constants.GLOBALS.MIN_STORE_SERVICE_ACTIVITY_NAME_LENGTH} minLength={Constants.GLOBALS.MIN_STORE_SERVICE_ACTIVITY_NAME_LENGTH}
maxLength={Constants.GLOBALS.MAX_STORE_SERVICE_ACTIVITY_NAME_LENGTH} maxLength={Constants.GLOBALS.MAX_STORE_SERVICE_ACTIVITY_NAME_LENGTH}
label={t("storeServices.serviceActivityName")} label={t("storeServices.serviceActivityName")}

View File

@ -56,9 +56,9 @@ export const Constants = {
MIN_PASSWORD_LENGTH: 8, MIN_PASSWORD_LENGTH: 8,
MAX_PASSWORD_LENGTH: 64, MAX_PASSWORD_LENGTH: 64,
MIN_STORE_SERVICE_NAME_LENGTH: 3, MIN_STORE_SERVICE_NAME_LENGTH: 3,
MAX_STORE_SERVICE_NAME_LENGTH: 32, MAX_STORE_SERVICE_NAME_LENGTH: 64,
MIN_STORE_SERVICE_ACTIVITY_NAME_LENGTH: 3, MIN_STORE_SERVICE_ACTIVITY_NAME_LENGTH: 3,
MAX_STORE_SERVICE_ACTIVITY_NAME_LENGTH: 32, MAX_STORE_SERVICE_ACTIVITY_NAME_LENGTH: 64,
MIN_STORE_SERVICE_ACTIVITY_DESCRIPTION_LENGTH: 3, MIN_STORE_SERVICE_ACTIVITY_DESCRIPTION_LENGTH: 3,
MAX_STORE_SERVICE_ACTIVITY_DESCRIPTION_LENGTH: 1024, MAX_STORE_SERVICE_ACTIVITY_DESCRIPTION_LENGTH: 1024,
MIN_STORE_SERVICE_ACTIVITY_PRICE: 0, MIN_STORE_SERVICE_ACTIVITY_PRICE: 0,