Performance improvement for users page

This commit is contained in:
2017-11-18 11:28:53 +01:00
parent 16c76670e8
commit bd293de4be
4 changed files with 35 additions and 2 deletions

21
pages/company/company.go Normal file
View File

@ -0,0 +1,21 @@
package company
import (
"net/http"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
)
// Get company.
func Get(ctx *aero.Context) string {
id := ctx.Get("id")
company, err := arn.GetCompany(id)
if err != nil {
return ctx.Error(http.StatusNotFound, "Company not found", err)
}
return ctx.HTML(components.CompanyPage(company))
}

View File

@ -0,0 +1,2 @@
component CompanyPage(company *arn.Company)
h1= company.Name.English