Skip to content

Commit

Permalink
Merge pull request #52 from cinaaaa/feat/study-areas
Browse files Browse the repository at this point in the history
fix: redirect issue
  • Loading branch information
cinaaaa authored Aug 22, 2022
2 parents 53be634 + c171c0a commit 4c08fb1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/resources/studyareas/StudyAreasEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,7 @@ export default function StudyAreasEdit() {
<OpportunityViewerComponent
opportunityData={opportunityData}
modalClosed={() => {
setOpportunityData(null);
window.location.reload();
location.reload();
}}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import {
SelectInput,
SimpleForm,
Toolbar,
useDelete,
useRedirect
useDelete
} from "react-admin";
import {
getOpportunitiesGroup,
Expand All @@ -24,15 +23,14 @@ import type { Opportunity } from "@types";
const label = { inputProps: { "aria-label": "Switch demo" } };

const DeleteButton = ({ id }: { id: number }) => {
const redirect = useRedirect();
const [deleteOne, { isLoading, error }] = useDelete(
"studyareas",
{
id: id
},
{
onSettled: () => {
redirect("/studyareas");
location.reload();
}
}
);
Expand Down

1 comment on commit 4c08fb1

@vercel
Copy link

@vercel vercel bot commented on 4c08fb1 Aug 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.