feat: boards with statuses fetch

This commit is contained in:
2025-08-03 13:40:09 +04:00
parent 624c94155c
commit 5435750fb5
21 changed files with 265 additions and 106 deletions

View File

@ -2,8 +2,8 @@
import { queryOptions } from "@tanstack/react-query";
import { client as _heyApiClient } from "../client.gen";
import { getProjects, type Options } from "../sdk.gen";
import type { GetProjectsData } from "../types.gen";
import { getBoards, getProjects, type Options } from "../sdk.gen";
import type { GetBoardsData, GetProjectsData } from "../types.gen";
export type QueryKey<TOptions extends Options> = [
Pick<TOptions, "baseURL" | "body" | "headers" | "path" | "query"> & {
@ -61,3 +61,24 @@ export const getProjectsOptions = (options?: Options<GetProjectsData>) => {
queryKey: getProjectsQueryKey(options),
});
};
export const getBoardsQueryKey = (options: Options<GetBoardsData>) =>
createQueryKey("getBoards", options);
/**
* Get Boards
*/
export const getBoardsOptions = (options: Options<GetBoardsData>) => {
return queryOptions({
queryFn: async ({ queryKey, signal }) => {
const { data } = await getBoards({
...options,
...queryKey[0],
signal,
throwOnError: true,
});
return data;
},
queryKey: getBoardsQueryKey(options),
});
};