func Index(env Env) (status Status, headers Headers, body Body) { apiProducts, err := services.AllProducts() if err != nil { panic(err) } apiBrands, err := services.AllBrands() if err != nil { panic(err) } apiUsers, err := services.GetUsers() if err != nil { panic(err) } homeViewData := &HomeViewData{ ApiProducts: apiProducts, ApiBrands: apiBrands, ApiUsers: apiUsers, } mangotemplate.ForRender(env, "feeds/index", homeViewData) return }
func Index(env Env) (status Status, headers Headers, body Body) { apiProducts, err := services.AllProducts() if err != nil { panic(err) } mangotemplate.ForRender(env, "products/index", &ProductViewData{ApiProducts: apiProducts}) return }