Meikan client v2
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.

index.ts 486B

1234567891011121314151617181920
  1. export const GetAnimeList = async (userID: number): Promise<UserAnime[]> => {
  2. const res = await fetch(`https://api.meikan.moe/v1/users/${userID}/anime`)
  3. const anime: UserAnime[] = await res.json()
  4. return anime
  5. }
  6. export const FindUsers = async (name: string): Promise<User[]> => {
  7. const res = await fetch('https://api.meikan.moe/v1/users', {
  8. method: 'POST',
  9. mode: 'cors',
  10. body: JSON.stringify({
  11. name,
  12. }),
  13. })
  14. const users: User[] = await res.json()
  15. return users
  16. }