Validation fix: Corrected fields should revert back from error-state (#19376)

Fixes PROD-278
This commit is contained in:
Princi Vershwal 2023-12-14 12:33:20 +05:30 committed by GitHub
parent a33ce7c20c
commit 3fef668394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -492,12 +492,14 @@ const AddOfferModal = () => {
let newOverrides = {...prevOverrides};
newOverrides.name = newValue;
if (!prevOverrides.code.isDirty) {
clearError('code');
newOverrides.code = {
...prevOverrides.code,
value: slugify(newValue)
};
}
if (!prevOverrides.displayTitle.isDirty) {
clearError('displayTitle');
newOverrides.displayTitle = {
...prevOverrides.displayTitle,
value: newValue