Limited ListEntries to user
This commit is contained in:
parent
ee499f5c3e
commit
f2b3fd06a8
1 changed files with 2 additions and 2 deletions
|
@ -130,11 +130,11 @@ func (database *Database) GetRunningEntryId(user string) (string, error) {
|
||||||
return runningId, dberr
|
return runningId, dberr
|
||||||
}
|
}
|
||||||
|
|
||||||
func (database *Database) ListEntries() ([]Entry, error) {
|
func (database *Database) ListEntries(user string) ([]Entry, error) {
|
||||||
var entries []Entry
|
var entries []Entry
|
||||||
|
|
||||||
dberr := database.DB.View(func(tx *buntdb.Tx) error {
|
dberr := database.DB.View(func(tx *buntdb.Tx) error {
|
||||||
tx.AscendKeys("*:entry:*", func(key, value string) bool {
|
tx.AscendKeys(user + ":entry:*", func(key, value string) bool {
|
||||||
var entry Entry
|
var entry Entry
|
||||||
json.Unmarshal([]byte(value), &entry)
|
json.Unmarshal([]byte(value), &entry)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue