parent
1f5a42d34c
commit
3611e99422
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user