summaryrefslogtreecommitdiff
path: root/internal/server/handler/handler.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/server/handler/handler.go')
-rw-r--r--internal/server/handler/handler.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/server/handler/handler.go b/internal/server/handler/handler.go
index 12c6660..8e2b867 100644
--- a/internal/server/handler/handler.go
+++ b/internal/server/handler/handler.go
@@ -62,12 +62,12 @@ func (h Handler) Get(w http.ResponseWriter, r *http.Request) error {
return fmt.Errorf("invalid id %s", id)
}
- data, err := repository.Instance(h.conf.DataDir).GetBytes(id)
- if err != err {
- return err
+ entry, ok := repository.Instance(h.conf.DataDir).Get(id)
+ if !ok {
+ return fmt.Errorf("no entry with id %s found", id)
}
- fmt.Fprint(w, string(data))
+ fmt.Fprint(w, entry.String())
return nil
}