getting rid of small annoyances

This commit is contained in:
Simon Martens
2026-01-11 11:38:31 +01:00
parent a2ecd125ab
commit 6175e9c99a
5 changed files with 43 additions and 24 deletions

View File

@@ -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
}