Strongly type everything

This commit is contained in:
Taevas 2023-05-10 19:55:11 +02:00
parent 842a627cac
commit fee3766c2b
18 changed files with 221 additions and 109 deletions

View file

@ -1,5 +1,6 @@
import { Handler } from '@netlify/functions'
import fetch from "node-fetch"
import { AnilistInfo } from '../../src/components/Anilist'
const handler: Handler = async (event, context) => {
let anilist = await fetch("https://graphql.anilist.co", {
@ -52,7 +53,7 @@ const handler: Handler = async (event, context) => {
let p_json = await anilist.json() as {[key: string]: any}
let json = p_json.data.MediaList
let anime = {
let anime: AnilistInfo = {
title: json.media.title.romaji,
episodes: {
watched: json.progress,