Implemented adding and removing anime

This commit is contained in:
2017-06-20 12:41:26 +02:00
parent 6bd57a9135
commit a0c8fb19ca
12 changed files with 119 additions and 27 deletions

View File

@ -1,6 +1,7 @@
package animelistitem
import (
"errors"
"net/http"
"github.com/aerogo/aero"
@ -29,12 +30,12 @@ func Get(ctx *aero.Context) string {
item := animeList.Find(animeID)
if item == nil {
return ctx.Error(http.StatusNotFound, "List item not found", err)
return ctx.Error(http.StatusNotFound, "List item not found", errors.New("This anime does not exist in "+viewUser.Nick+"'s anime list"))
}
anime := item.Anime()
return ctx.HTML(components.AnimeListItem(item, anime))
return ctx.HTML(components.AnimeListItem(animeList.User(), item, anime))
}
// t := reflect.TypeOf(item).Elem()