mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2025-10-29 09:15:33 +00:00
Lesekabinett & Startseite
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
package dbmodels
|
||||
|
||||
import (
|
||||
"iter"
|
||||
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
)
|
||||
import ()
|
||||
|
||||
// INFO: Iterator queries to be reused
|
||||
// Rules
|
||||
@@ -15,23 +11,24 @@ import (
|
||||
// 3. Naming convention: Iter_<TableName>_<FilteredField>[s]
|
||||
|
||||
// BUG: this is not working as expected, see Iter_TableByField in queryhelpers.go
|
||||
func Iter_REntriesAgents_Agent(app core.App, id string) (iter.Seq2[*REntriesAgents, error], error) {
|
||||
innerIterator, err := Iter_TableByField[REntriesAgents](
|
||||
app,
|
||||
RelationTableName(ENTRIES_TABLE, AGENTS_TABLE),
|
||||
AGENTS_TABLE,
|
||||
id,
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return func(yield func(*REntriesAgents, error) bool) {
|
||||
for item, err := range innerIterator {
|
||||
if !yield(item, err) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}, nil
|
||||
}
|
||||
// func Iter_REntriesAgents_Agent(app core.App, id string) (iter.Seq2[*REntriesAgents, error], error) {
|
||||
// innerIterator, err := Iter_TableByField[REntriesAgents](
|
||||
// app,
|
||||
// RelationTableName(ENTRIES_TABLE, AGENTS_TABLE),
|
||||
// AGENTS_TABLE,
|
||||
// id,
|
||||
// )
|
||||
//
|
||||
// if err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
//
|
||||
// return func(yield func(*REntriesAgents, error) bool) {
|
||||
// for item, err := range innerIterator {
|
||||
// if !yield(item, err) {
|
||||
// return
|
||||
// }
|
||||
// }
|
||||
// }, nil
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user