feat: status updating on the server and statuses fetching
This commit is contained in:
@ -2,7 +2,6 @@
|
||||
|
||||
import React from "react";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { AxiosError } from "axios";
|
||||
import { ScrollArea } from "@mantine/core";
|
||||
import Board from "@/app/deals/components/Board/Board";
|
||||
import { useBoardsContext } from "@/app/deals/contexts/BoardsContext";
|
||||
@ -10,17 +9,16 @@ import { BoardSchema } from "@/client";
|
||||
import { updateBoardMutation } from "@/client/@tanstack/react-query.gen";
|
||||
import SortableDnd from "@/components/SortableDnd";
|
||||
import { notifications } from "@/lib/notifications";
|
||||
import { ErrorBody } from "@/types/ErrorBody";
|
||||
|
||||
const Boards = () => {
|
||||
const { boards, setSelectedBoard, refetchBoards } = useBoardsContext();
|
||||
|
||||
const updateBoard = useMutation({
|
||||
...updateBoardMutation(),
|
||||
onError: (error: AxiosError<ErrorBody>) => {
|
||||
onError: error => {
|
||||
console.error(error);
|
||||
notifications.error({
|
||||
message: error.response?.data?.detail,
|
||||
message: error.response?.data?.detail as string | undefined,
|
||||
});
|
||||
refetchBoards();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user