Started working on Kitsu import
This commit is contained in:
@ -26,4 +26,18 @@ export function malDiffFilterAnime(arn: AnimeNotifier, input: HTMLInputElement)
|
||||
let type = arn.app.find("filter-type") as HTMLSelectElement
|
||||
|
||||
arn.app.load(`/editor/anime/maldiff/${year.value}/${status.value}/${type.value}`)
|
||||
}
|
||||
|
||||
// Import Kitsu anime
|
||||
export async function importKitsuAnime(arn: AnimeNotifier, button: HTMLButtonElement) {
|
||||
let response = await fetch(`/api/import/kitsu/anime/${button.dataset.id}`, {
|
||||
method: "POST",
|
||||
credentials: "same-origin"
|
||||
})
|
||||
|
||||
if(response.ok) {
|
||||
arn.reloadContent()
|
||||
} else {
|
||||
arn.statusMessage.showError(await response.text())
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user