mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2026-02-04 10:35:30 +00:00
getting rid of small annoyances
This commit is contained in:
@@ -32,3 +32,16 @@ func (e *Entry) Next(app core.App) *Entry {
|
||||
|
||||
return &entry
|
||||
}
|
||||
|
||||
func TitleSearchEntries(app core.App, query string) ([]*Entry, error) {
|
||||
entries := []*Entry{}
|
||||
err := app.RecordQuery(ENTRIES_TABLE).
|
||||
Where(dbx.Like(PREFERRED_TITLE_FIELD, query).Match(true, true)).
|
||||
OrderBy(PREFERRED_TITLE_FIELD).
|
||||
All(&entries)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return entries, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user