Skip to content

Commit

Permalink
Fix: Frontend now reflects advertisement deletion, aligning with back…
Browse files Browse the repository at this point in the history
…end updates. (#1113)
  • Loading branch information
aialok authored Dec 2, 2023
1 parent da35be1 commit f61b79e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Button, Card, Col, Row, Spinner } from 'react-bootstrap';
import { DELETE_ADVERTISEMENT_BY_ID } from 'GraphQl/Mutations/mutations';
import { useMutation } from '@apollo/client';
import { useTranslation } from 'react-i18next';
import { ADVERTISEMENTS_GET } from 'GraphQl/Queries/Queries';
interface InterfaceAddOnEntryProps {
id: string;
name: string;
Expand All @@ -27,7 +28,9 @@ function advertisementEntry({
}: InterfaceAddOnEntryProps): JSX.Element {
const { t } = useTranslation('translation', { keyPrefix: 'advertisement' });
const [buttonLoading, setButtonLoading] = useState(false);
const [deleteAdById] = useMutation(DELETE_ADVERTISEMENT_BY_ID);
const [deleteAdById] = useMutation(DELETE_ADVERTISEMENT_BY_ID, {
refetchQueries: [ADVERTISEMENTS_GET],
});

const onDelete = async (): Promise<void> => {
setButtonLoading(true);
Expand Down

0 comments on commit f61b79e

Please sign in to comment.