2016-11-22 03:34:59 +00:00
|
|
|
package posts
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/aerogo/aero"
|
|
|
|
"github.com/animenotifier/arn"
|
|
|
|
"github.com/animenotifier/notify.moe/components"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Get ...
|
|
|
|
func Get(ctx *aero.Context) string {
|
|
|
|
id := ctx.Get("id")
|
|
|
|
post, err := arn.GetPost(id)
|
|
|
|
|
|
|
|
if err != nil {
|
2016-11-23 05:26:59 +00:00
|
|
|
return ctx.Error(404, "Post not found", err)
|
2016-11-22 03:34:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return ctx.HTML(components.Post(post))
|
|
|
|
}
|