Close offer modal after archiving/reactivating (#19437)

fixes PROD-284
This commit is contained in:
Sodbileg Gansukh 2024-01-04 09:17:53 +07:00 committed by GitHub
parent 1f5a42d34c
commit 3611e99422
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,6 +34,8 @@ const Sidebar: React.FC<{
const [nameLength, setNameLength] = useState(offer?.name.length || 0);
const nameLengthColor = nameLength > 40 ? 'text-red' : 'text-green';
const {updateRoute} = useRouting();
useEffect(() => {
if (offer?.name) {
setNameLength(offer?.name.length);
@ -66,6 +68,7 @@ const Sidebar: React.FC<{
type: 'success',
message: 'Offer archived successfully'
});
updateRoute('offers/edit');
} catch (e) {
handleError(e);
}
@ -86,6 +89,7 @@ const Sidebar: React.FC<{
type: 'success',
message: 'Offer reactivated successfully'
});
updateRoute('offers/edit');
} catch (e) {
handleError(e);
}