From 1c22b87b74d8d0e84b78cb6c8a5830849cde7f90 Mon Sep 17 00:00:00 2001 From: elraphty Date: Wed, 10 Jul 2024 18:07:21 +0100 Subject: [PATCH] added uuid to LNURL auth return data --- db/db.go | 12 ++++++++++-- handlers/auth.go | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/db/db.go b/db/db.go index 5797971fd..072c6e1a5 100644 --- a/db/db.go +++ b/db/db.go @@ -750,8 +750,12 @@ func (db database) GetWorkspaceBountiesCount(r *http.Request, workspace_uuid str } func (db database) GetAssignedBounties(r *http.Request) ([]NewBounty, error) { - offset, limit, sortBy, direction, _ := utils.GetPaginationParams(r) uuid := chi.URLParam(r, "uuid") + if uuid == "" { + return []NewBounty{}, nil + } + + offset, limit, sortBy, direction, _ := utils.GetPaginationParams(r) person := db.GetPersonByUuid(uuid) pubkey := person.OwnerPubKey keys := r.URL.Query() @@ -799,8 +803,12 @@ func (db database) GetAssignedBounties(r *http.Request) ([]NewBounty, error) { } func (db database) GetCreatedBounties(r *http.Request) ([]NewBounty, error) { - offset, limit, sortBy, direction, _ := utils.GetPaginationParams(r) uuid := chi.URLParam(r, "uuid") + if uuid == "" { + return []NewBounty{}, nil + } + + offset, limit, sortBy, direction, _ := utils.GetPaginationParams(r) person := db.GetPersonByUuid(uuid) pubkey := person.OwnerPubKey keys := r.URL.Query() diff --git a/handlers/auth.go b/handlers/auth.go index 15f987eae..f30abeb7e 100644 --- a/handlers/auth.go +++ b/handlers/auth.go @@ -232,6 +232,7 @@ func returnUserMap(p db.Person) map[string]interface{} { user := make(map[string]interface{}) user["id"] = p.ID + user["uuid"] = p.Uuid user["created"] = p.Created user["owner_pubkey"] = p.OwnerPubKey user["owner_alias"] = p.OwnerAlias