24 lines
479 B
Go
Raw Normal View History

2017-11-18 11:28:53 +01:00
package company
import (
"net/http"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
2017-11-18 11:46:17 +01:00
"github.com/animenotifier/notify.moe/utils"
2017-11-18 11:28:53 +01:00
)
// Get company.
func Get(ctx *aero.Context) string {
2017-11-18 11:46:17 +01:00
user := utils.GetUser(ctx)
2017-11-18 11:28:53 +01:00
id := ctx.Get("id")
company, err := arn.GetCompany(id)
if err != nil {
return ctx.Error(http.StatusNotFound, "Company not found", err)
}
2017-11-18 11:46:17 +01:00
return ctx.HTML(components.CompanyPage(company, user))
2017-11-18 11:28:53 +01:00
}