There was an error while loading. Please reload this page.
1 parent 139da06 commit 055ed53Copy full SHA for 055ed53
1 file changed
js/src/app/duel/_components/PartyCreate.tsx
@@ -1,5 +1,6 @@
1
import { useCreatePartyMutation } from "@/lib/api/queries/duels";
2
import { Box, Button } from "@mantine/core";
3
+import { notifications } from "@mantine/notifications";
4
import { useNavigate } from "react-router";
5
6
export default function PartyCreate() {
@@ -9,9 +10,12 @@ export default function PartyCreate() {
9
10
const onCreate = () => {
11
mutate(undefined, {
12
onSuccess: (response) => {
- console.log(response);
13
-
14
- navigate(`/duel/${response.payload?.code}`);
+ const code = response.payload?.code;
+ if (code) {
15
+ navigate(`/duel/${code}`);
16
+ } else {
17
+ notifications.show({ message: "Failed to create party" });
18
+ }
19
},
20
});
21
};
0 commit comments