aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Data/Birthday/secondary.ts
blob: 5cf26c56291dd875021e942d1068f744e456ee31 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import root from '$lib/Utility/root';

export interface ACDBBirthday {
  character_image: string;
  name: string;
  origin: string;
}

export const ACDBBirthdays = async (month: number, day: number): Promise<ACDBBirthday[]> =>
  (
    await (
      await fetch(root(`/api/birthdays/secondary?month=${month}&day=${day}`), {
        headers: {
          Accept: 'application/json',
          'Content-Type': 'application/json',
          'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0'
        }
      })
    ).json()
  )['characters'];