Skip to content

Commit 055ed53

Browse files
490: copilot fixes
1 parent 139da06 commit 055ed53

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

js/src/app/duel/_components/PartyCreate.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useCreatePartyMutation } from "@/lib/api/queries/duels";
22
import { Box, Button } from "@mantine/core";
3+
import { notifications } from "@mantine/notifications";
34
import { useNavigate } from "react-router";
45

56
export default function PartyCreate() {
@@ -9,9 +10,12 @@ export default function PartyCreate() {
910
const onCreate = () => {
1011
mutate(undefined, {
1112
onSuccess: (response) => {
12-
console.log(response);
13-
14-
navigate(`/duel/${response.payload?.code}`);
13+
const code = response.payload?.code;
14+
if (code) {
15+
navigate(`/duel/${code}`);
16+
} else {
17+
notifications.show({ message: "Failed to create party" });
18+
}
1519
},
1620
});
1721
};

0 commit comments

Comments
 (0)