feat: board updating on the server

This commit is contained in:
2025-08-04 16:57:54 +04:00
parent f13417e73a
commit 24de9f5446
8 changed files with 172 additions and 15 deletions

View File

@ -11,6 +11,9 @@ import type {
GetDealsResponses,
GetProjectsData,
GetProjectsResponses,
UpdateBoardData,
UpdateBoardErrors,
UpdateBoardResponses,
} from "./types.gen";
export type Options<
@ -59,11 +62,32 @@ export const getBoards = <ThrowOnError extends boolean = false>(
ThrowOnError
>({
responseType: "json",
url: "/board/{project_id}",
url: "/board/{projectId}",
...options,
});
};
/**
* Update Board
*/
export const updateBoard = <ThrowOnError extends boolean = false>(
options: Options<UpdateBoardData, ThrowOnError>
) => {
return (options.client ?? _heyApiClient).patch<
UpdateBoardResponses,
UpdateBoardErrors,
ThrowOnError
>({
responseType: "json",
url: "/board/{boardId}",
...options,
headers: {
"Content-Type": "application/json",
...options.headers,
},
});
};
/**
* Get Deals
*/
@ -76,7 +100,7 @@ export const getDeals = <ThrowOnError extends boolean = false>(
ThrowOnError
>({
responseType: "json",
url: "/deal/{board_id}",
url: "/deal/{boardId}",
...options,
});
};