computer-scienceangular-roadmapbackend-roadmapblockchain-roadmapdba-roadmapdeveloper-roadmapdevops-roadmapfrontend-roadmapgo-roadmaphactoberfestjava-roadmapjavascript-roadmapnodejs-roadmappython-roadmapqa-roadmapreact-roadmaproadmapstudy-planvue-roadmapweb3-roadmap
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
856 B
35 lines
856 B
7 months ago
|
import { type APIContext } from 'astro';
|
||
|
import { api } from './api.ts';
|
||
|
import type { RoadmapDocument } from '../components/CustomRoadmap/CreateRoadmap/CreateRoadmapModal.tsx';
|
||
|
|
||
|
export type ListShowcaseRoadmapResponse = {
|
||
|
data: Pick<
|
||
|
RoadmapDocument,
|
||
|
| '_id'
|
||
|
| 'title'
|
||
|
| 'description'
|
||
|
| 'slug'
|
||
|
| 'creatorId'
|
||
|
| 'visibility'
|
||
|
| 'createdAt'
|
||
|
| 'topicCount'
|
||
|
| 'ratings'
|
||
|
>[];
|
||
|
totalCount: number;
|
||
|
totalPages: number;
|
||
|
currPage: number;
|
||
|
perPage: number;
|
||
|
};
|
||
|
|
||
|
export function roadmapApi(context: APIContext) {
|
||
|
return {
|
||
|
listShowcaseRoadmap: async function () {
|
||
|
const searchParams = new URLSearchParams(context.url.searchParams);
|
||
|
return api(context).get<ListShowcaseRoadmapResponse>(
|
||
|
`${import.meta.env.PUBLIC_API_URL}/v1-list-showcase-roadmap`,
|
||
|
searchParams,
|
||
|
);
|
||
|
},
|
||
|
};
|
||
|
}
|