diff options
author | Vidhu Kant Sharma <vidhukant@protonmail.ch> | 2022-02-14 23:02:38 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@protonmail.ch> | 2022-02-14 23:02:38 +0530 |
commit | 74a5f1ce1594d01ef7caeb3c5fcac047a7d8f9b3 (patch) | |
tree | 24123f6e0dc0d7663ea8e4ddf9de366cd1874f79 /user/anime/animelist.go | |
parent | a5a96fe4673048d49f8f14665e4065e199b1179b (diff) |
fixed UpdateAnime not working, though incomplete and kinda dangerous right now
Diffstat (limited to 'user/anime/animelist.go')
-rw-r--r-- | user/anime/animelist.go | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/user/anime/animelist.go b/user/anime/animelist.go index 8a673c1..78242ac 100644 --- a/user/anime/animelist.go +++ b/user/anime/animelist.go @@ -20,7 +20,6 @@ import ( "encoding/json" "strconv" "fmt" - "log" "errors" a "github.com/MikunoNaka/mal2go/anime" e "github.com/MikunoNaka/mal2go/errhandlers" @@ -39,20 +38,10 @@ func (c AnimeListClient)DeleteAnime(id int) string { // Update/Add an anime to user's anime list func (c AnimeListClient)UpdateAnime(id int, data UpdateAnimeData) serverResponse { - /* NOTE: UpdateAnime only adds anime to the list - * It doesn't add new anime to the list. - * This might be a problem with MAL, - * I haven't researched this much */ endpoint := fmt.Sprintf("%s/anime/%d/my_list_status", BASE_URL, id) - // turn data struct into json - jsonData, err := json.Marshal(data) - if err != nil { - log.Println(err) - } - - // finally make API request - res := c.putRequestHandler(endpoint, jsonData) + // make API request + res := c.putRequestHandler(endpoint, data) return res } |