added ability to delete entries. Added MAL RefreshToken Function
This commit is contained in:
@ -489,3 +489,39 @@ func (a *App) AniListUpdateEntry(updateBody AniListUpdateVariables) AniListGetSi
|
||||
|
||||
return post
|
||||
}
|
||||
|
||||
func (a *App) AniListDeleteEntry(mediaListId int) DeleteAniListReturn {
|
||||
type Variables = struct {
|
||||
Id int `json:"id"`
|
||||
}
|
||||
|
||||
body := struct {
|
||||
Query string `json:"query"`
|
||||
Variables Variables `json:"variables"`
|
||||
}{
|
||||
Query: `
|
||||
mutation(
|
||||
$id:Int,
|
||||
){
|
||||
DeleteMediaListEntry(
|
||||
id:$id,
|
||||
){
|
||||
deleted
|
||||
}
|
||||
}
|
||||
`,
|
||||
Variables: Variables{
|
||||
Id: mediaListId,
|
||||
},
|
||||
}
|
||||
|
||||
returnedBody, _ := AniListQuery(body, true)
|
||||
|
||||
var post DeleteAniListReturn
|
||||
err := json.Unmarshal(returnedBody, &post)
|
||||
if err != nil {
|
||||
log.Printf("Failed at unmarshal, %s\n", err)
|
||||
}
|
||||
|
||||
return post
|
||||
}
|
||||
|
Reference in New Issue
Block a user