diff options
author | Vidhu Kant Sharma <vidhukant@protonmail.ch> | 2022-02-13 16:56:09 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@protonmail.ch> | 2022-02-13 16:56:09 +0530 |
commit | 419e08bc3a369a0c1138871184e1a30320032afd (patch) | |
tree | c32a78c0c6f16416f42975cac86fbfc23d1b1735 /user/anime/animelist.go | |
parent | 208cb52b47278315b5227251d5b65c07908cde23 (diff) |
added functionality to update anime list of authenticated user
Diffstat (limited to 'user/anime/animelist.go')
-rw-r--r-- | user/anime/animelist.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/user/anime/animelist.go b/user/anime/animelist.go index 120bdea..4f5eac5 100644 --- a/user/anime/animelist.go +++ b/user/anime/animelist.go @@ -37,9 +37,19 @@ func (c AnimeListClient)DeleteAnime(id int) string { } // Update/Add an anime to user's anime list -// func UpdateAnime(id int) { +func (c AnimeListClient)UpdateAnime(id int, data UpdateAnimeData) string { + endpoint := fmt.Sprintf("%s/anime/%d/my_list_status", BASE_URL, id) + + // turn data struct into json + pepe, err := json.Marshal(data) + if err != nil { + fmt.Println(err) + } -// } + // finally make API request + res := c.putRequestHandler(endpoint, pepe) + return res +} // Get authenticated user's anime list func (c AnimeListClient) GetAnimeList(user, status, sort string, limit, offset int) (a.AnimeList, error){ |