mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2025-10-29 17:25:32 +00:00
Alle Abfragen für Reihen-Seite
This commit is contained in:
17
dbmodels/agents.go
Normal file
17
dbmodels/agents.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package dbmodels
|
||||
|
||||
import (
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
)
|
||||
|
||||
func AgentForId(app core.App, id string) (*Agent, error) {
|
||||
agent := &Agent{}
|
||||
err := app.RecordQuery(AGENTS_TABLE).
|
||||
Where(dbx.HashExp{ID_FIELD: id}).
|
||||
One(agent)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return agent, nil
|
||||
}
|
||||
Reference in New Issue
Block a user