chapter-tracker/src/mangadex/manga.ts
2025-04-20 12:52:11 +10:00

19 lines
441 B
TypeScript

import axios from 'axios';
import { Manga } from '../types';
export const getManga = async (id: string): Promise<Manga> => {
const response = await axios.get<{
data: Manga;
limit: number;
offset: number;
total: number;
}>(`https://api.mangadex.org/manga/${id}`, {
headers: {
'User-Agent':
'Personal Chapter Update Tracker (Maintained by: https://pfy.ch)',
},
});
return response.data.data;
};