From f2b3fd06a82bb8f3b747085ce972ed7ee47f4bd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=9E=E3=83=AA=E3=82=A6=E3=82=B9?= Date: Thu, 15 Oct 2020 22:44:48 +0100 Subject: [PATCH] Limited ListEntries to user --- z/database.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/z/database.go b/z/database.go index 3cc2ad7..e955eb1 100644 --- a/z/database.go +++ b/z/database.go @@ -130,11 +130,11 @@ func (database *Database) GetRunningEntryId(user string) (string, error) { return runningId, dberr } -func (database *Database) ListEntries() ([]Entry, error) { +func (database *Database) ListEntries(user string) ([]Entry, error) { var entries []Entry 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 json.Unmarshal([]byte(value), &entry)