Princi Vershwal 2023-12-13 12:46:26 +05:30 committed by GitHub
parent b7648e7bc2
commit 830967d2ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View File

@ -57,6 +57,7 @@ const Offers: React.FC<{ keywords: string[] }> = ({keywords}) => {
};
const goToOfferEdit = (offerId: string) => {
sessionStorage.setItem('editOfferPageSource', 'offers');
updateRoute(`offers/edit/${offerId}`);
};

View File

@ -269,7 +269,13 @@ const EditOfferModal: React.FC<{id: string}> = ({id}) => {
title='Offer'
width={1140}
onCancel={() => {
if (sessionStorage.getItem('editOfferPageSource') === 'offers') {
sessionStorage.removeItem('editOfferPageSource');
updateRoute('offers');
} else {
sessionStorage.removeItem('editOfferPageSource');
updateRoute('offers/edit');
}
}}
onOk={async () => {
if (!(await handleSave({fakeWhenUnchanged: true}))) {

View File

@ -126,6 +126,7 @@ export const OffersIndexModal = () => {
const handleOfferEdit = (id:string) => {
// TODO: implement
sessionStorage.setItem('editOfferPageSource', 'offersIndex');
updateRoute(`offers/edit/${id}`);
};