Skip to content

Commit

Permalink
Merge pull request stakwork#1860 from stakwork/fix/lnurlauth_user
Browse files Browse the repository at this point in the history
Fix UUID Undefined Error For LNAUTH USERs
  • Loading branch information
elraphty authored Jul 10, 2024
2 parents 680c366 + 1c22b87 commit c40cc82
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions handlers/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c40cc82

Please sign in to comment.