19 lines
441 B
TypeScript
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;
|
|
};
|