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();
})
.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(() =>
@ -590,7 +599,16 @@ function ModalAddEditService({
fetchServices();
})
.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(() =>
@ -725,7 +743,16 @@ function ModalAddEditServiceActivity({
fetchServices();
})
.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(() =>
@ -831,7 +858,16 @@ function ModalAddEditServiceActivity({
fetchServices();
})
.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(() =>
@ -886,6 +922,9 @@ function ServiceNameFormInput({ formItemName }) {
return (
<MyFormInput
formItemName={formItemName}
propsInput={{
showCount: true,
}}
minLength={Constants.GLOBALS.MIN_STORE_SERVICE_NAME_LENGTH}
maxLength={Constants.GLOBALS.MAX_STORE_SERVICE_NAME_LENGTH}
label={t("storeServices.serviceName")}
@ -909,6 +948,9 @@ function ServiceActivityNameFormInput({ formItemName }) {
return (
<MyFormInput
formItemName={formItemName}
propsInput={{
showCount: true,
}}
minLength={Constants.GLOBALS.MIN_STORE_SERVICE_ACTIVITY_NAME_LENGTH}
maxLength={Constants.GLOBALS.MAX_STORE_SERVICE_ACTIVITY_NAME_LENGTH}
label={t("storeServices.serviceActivityName")}

View File

@ -56,9 +56,9 @@ export const Constants = {
MIN_PASSWORD_LENGTH: 8,
MAX_PASSWORD_LENGTH: 64,
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,
MAX_STORE_SERVICE_ACTIVITY_NAME_LENGTH: 32,
MAX_STORE_SERVICE_ACTIVITY_NAME_LENGTH: 64,
MIN_STORE_SERVICE_ACTIVITY_DESCRIPTION_LENGTH: 3,
MAX_STORE_SERVICE_ACTIVITY_DESCRIPTION_LENGTH: 1024,
MIN_STORE_SERVICE_ACTIVITY_PRICE: 0,