Update to new goprogram version
This commit is contained in:
parent
7bd9570bc0
commit
873fdcd5c2
106 changed files with 478 additions and 825 deletions
|
|
@ -12,7 +12,7 @@ import (
|
|||
|
||||
type API struct {
|
||||
component.Base
|
||||
Dependencies struct {
|
||||
dependencies struct {
|
||||
Auth *auth.Auth
|
||||
}
|
||||
}
|
||||
|
|
@ -31,7 +31,7 @@ func (api *API) Routes() component.Routes {
|
|||
func (a *API) HandleRoute(ctx context.Context, path string) (http.Handler, error) {
|
||||
return &api.Handler[[]Item]{
|
||||
Config: a.Config,
|
||||
Auth: a.Dependencies.Auth,
|
||||
Auth: a.dependencies.Auth,
|
||||
|
||||
Methods: []string{"GET"},
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import (
|
|||
|
||||
type News struct {
|
||||
component.Base
|
||||
Dependencies struct {
|
||||
dependencies struct {
|
||||
Templating *templating.Templating
|
||||
}
|
||||
}
|
||||
|
|
@ -104,8 +104,8 @@ func Items() ([]Item, error) {
|
|||
}
|
||||
}
|
||||
|
||||
slices.SortFunc(items, func(a, b Item) bool {
|
||||
return !a.Date.Before(b.Date)
|
||||
slices.SortFunc(items, func(a, b Item) int {
|
||||
return a.Date.Compare(b.Date)
|
||||
})
|
||||
|
||||
return items, nil
|
||||
|
|
@ -132,7 +132,7 @@ var (
|
|||
// HandleRoute returns the handler for the requested path
|
||||
func (news *News) HandleRoute(ctx context.Context, path string) (http.Handler, error) {
|
||||
tpl := newsTemplate.Prepare(
|
||||
news.Dependencies.Templating,
|
||||
news.dependencies.Templating,
|
||||
templating.Crumbs(
|
||||
menuNews,
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue