mirror of
https://github.com/SomboChea/ui
synced 2024-11-11 00:54:26 +07:00
15 lines
482 B
TypeScript
15 lines
482 B
TypeScript
import API from './api';
|
|
import { PackageMetaInterface } from 'types/packageMeta';
|
|
|
|
export interface DetailPage {
|
|
readMe: string | {};
|
|
packageMeta: PackageMetaInterface | {};
|
|
}
|
|
|
|
export async function callDetailPage(packageName): Promise<DetailPage> {
|
|
const readMe = await API.request<string | {}>(`package/readme/${packageName}`, 'GET');
|
|
const packageMeta = await API.request<PackageMetaInterface | {}>(`sidebar/${packageName}`, 'GET');
|
|
|
|
return { readMe, packageMeta };
|
|
}
|