Suche nach Musenalm-ID implementiert

This commit is contained in:
Simon Martens
2025-02-20 20:12:17 +01:00
parent cdf8d74cf7
commit 63bef6237a
8 changed files with 121 additions and 32 deletions

View File

@@ -1,12 +1,26 @@
package dbmodels
import (
"strconv"
"github.com/pocketbase/dbx"
"github.com/pocketbase/pocketbase/core"
)
type EntriesAgents map[string][]*REntriesAgents
func EntriesForID(app core.App, query int) ([]*Entry, error) {
entries := []*Entry{}
err := app.RecordQuery(ENTRIES_TABLE).
Where(dbx.HashExp{MUSENALMID_FIELD: strconv.Itoa(query)}).
All(&entries)
if err != nil {
return nil, err
}
return entries, nil
}
func YearsForEntries(app core.App) ([]int, error) {
rec := []core.Record{}
err := app.RecordQuery(ENTRIES_TABLE).