Skip to content

Commit

Permalink
return user to dashboard on topic delete
Browse files Browse the repository at this point in the history
  • Loading branch information
Snazzie committed Mar 5, 2024
1 parent a111ef9 commit 2c62d4a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Source/Topica.UI/src/pages/Topic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const Topic: React.FunctionComponent = (props) => {
{ manual: true },
);

const { deleteError, run: Delete } = useRequest(
const { deleteError, runAsync: Delete } = useRequest(
() => topicsApi.deleteTopic({ topicId: params.id ?? "" }),
{ manual: true },
);
Expand All @@ -33,7 +33,9 @@ export const Topic: React.FunctionComponent = (props) => {
type="primary"
style={{ alignSelf: "center" }}
danger
onClick={Delete}
onClick={() => {
Delete().then(() => navigate("/"));
}}
>
Delete Topic
</Button>
Expand Down

0 comments on commit 2c62d4a

Please sign in to comment.