|
|
|
@@ -19,8 +19,9 @@ import { |
|
|
|
import selectedTheme from "../../../../themes"; |
|
|
|
import { ReactComponent as Category } from "../../../../assets/images/svg/category.svg"; |
|
|
|
import BackdropComponent from "../../../MUI/BackdropComponent"; |
|
|
|
import { useDispatch } from "react-redux"; |
|
|
|
import { useDispatch, useSelector } from "react-redux"; |
|
|
|
import { |
|
|
|
fetchOffers, |
|
|
|
fetchProfileOffers, |
|
|
|
removeOffer, |
|
|
|
} from "../../../../store/actions/offers/offersActions"; |
|
|
|
@@ -28,10 +29,12 @@ import { useTranslation, Trans } from "react-i18next"; |
|
|
|
import { useHistory } from "react-router-dom"; |
|
|
|
import useIsMobile from "../../../../hooks/useIsMobile"; |
|
|
|
import { getImageUrl, variants } from "../../../../util/helpers/imageUrlGetter"; |
|
|
|
import { selectQueryString } from "../../../../store/selectors/queryStringSelectors"; |
|
|
|
|
|
|
|
const DeleteOffer = (props) => { |
|
|
|
const dispatch = useDispatch(); |
|
|
|
const { t } = useTranslation(); |
|
|
|
const queryString = useSelector(selectQueryString); |
|
|
|
const history = useHistory(); |
|
|
|
const userId = props.offer.userId; |
|
|
|
const { isMobile } = useIsMobile(); |
|
|
|
@@ -42,6 +45,7 @@ const DeleteOffer = (props) => { |
|
|
|
|
|
|
|
const handleApiResponseSuccess = () => { |
|
|
|
dispatch(fetchProfileOffers(userId)); |
|
|
|
dispatch(fetchOffers({ queryString })); |
|
|
|
}; |
|
|
|
|
|
|
|
const removeOfferHandler = () => { |