30 lines
774 B
TypeScript
30 lines
774 B
TypeScript
// React Query option builders for blog feature procedures.
|
|
// Consumed by apps via the @repo/core-trpc client (wired in Plan 5).
|
|
|
|
type TrpcClient = {
|
|
blog: {
|
|
articleBySlug: {
|
|
queryOptions: (input: { slug: string }) => unknown;
|
|
};
|
|
listArticles: {
|
|
queryOptions: (input?: {
|
|
status?: string;
|
|
authorId?: string;
|
|
limit?: number;
|
|
offset?: number;
|
|
}) => unknown;
|
|
};
|
|
};
|
|
};
|
|
|
|
export function articleBySlugQuery(client: TrpcClient, slug: string) {
|
|
return client.blog.articleBySlug.queryOptions({ slug });
|
|
}
|
|
|
|
export function listArticlesQuery(
|
|
client: TrpcClient,
|
|
options?: { status?: string; authorId?: string; limit?: number; offset?: number },
|
|
) {
|
|
return client.blog.listArticles.queryOptions(options);
|
|
}
|