mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-09-25 00:21:28 +02:00
24 lines
525 B
TypeScript
24 lines
525 B
TypeScript
import { queryOptions } from '@tanstack/react-query';
|
|
import { httpGet } from '../lib/query-http';
|
|
|
|
export interface OfficialRoadmapDocument {
|
|
_id: string;
|
|
title: string;
|
|
description?: string;
|
|
slug: string;
|
|
nodes: any[];
|
|
edges: any[];
|
|
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
}
|
|
|
|
export function officialRoadmapOptions(slug: string) {
|
|
return queryOptions({
|
|
queryKey: ['official-roadmap', slug],
|
|
queryFn: () => {
|
|
return httpGet<OfficialRoadmapDocument>(`/v1-official-roadmap/${slug}`);
|
|
},
|
|
});
|
|
}
|