feat: board updating on the server
This commit is contained in:
@ -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,
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user