Skip to content

Commit

Permalink
updated created and assigned bounties with uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
elraphty committed Feb 13, 2024
1 parent 2c4c1af commit 89b4b4e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
8 changes: 6 additions & 2 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,9 @@ func (db database) GetOrganizationBounties(r *http.Request, org_uuid string) []B

func (db database) GetAssignedBounties(r *http.Request) ([]Bounty, error) {
offset, limit, sortBy, direction, _ := utils.GetPaginationParams(r)
pubkey := chi.URLParam(r, "pubkey")
uuid := chi.URLParam(r, "uuid")
person := db.GetPersonByUuid(uuid)
pubkey := person.OwnerPubKey

orderQuery := ""
limitQuery := ""
Expand All @@ -682,7 +684,9 @@ func (db database) GetAssignedBounties(r *http.Request) ([]Bounty, error) {

func (db database) GetCreatedBounties(r *http.Request) ([]Bounty, error) {
offset, limit, sortBy, direction, _ := utils.GetPaginationParams(r)
pubkey := chi.URLParam(r, "pubkey")
uuid := chi.URLParam(r, "uuid")
person := db.GetPersonByUuid(uuid)
pubkey := person.OwnerPubKey

orderQuery := ""
limitQuery := ""
Expand Down
1 change: 1 addition & 0 deletions handlers/people.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ func GetPersonByUuid(w http.ResponseWriter, r *http.Request) {
personResponse := make(map[string]interface{})
personResponse["id"] = person.ID
personResponse["uuid"] = person.Uuid
personResponse["owner_pubkey"] = person.OwnerPubKey
personResponse["owner_alias"] = person.OwnerAlias
personResponse["unique_name"] = person.UniqueName
personResponse["description"] = person.Description
Expand Down
4 changes: 2 additions & 2 deletions routes/people.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ func PeopleRoutes() chi.Router {
r.Get("/", handlers.GetListedPeople)
r.Get("/search", handlers.GetPeopleBySearch)
r.Get("/posts", handlers.GetListedPosts)
r.Get("/wanteds/assigned/{pubkey}", handlers.GetPersonAssignedBounties)
r.Get("/wanteds/created/{pubkey}", handlers.GetPersonCreatedBounties)
r.Get("/wanteds/assigned/{uuid}", handlers.GetPersonAssignedBounties)
r.Get("/wanteds/created/{uuid}", handlers.GetPersonCreatedBounties)
r.Get("/wanteds/header", handlers.GetWantedsHeader)
r.Get("/short", handlers.GetPeopleShortList)
r.Get("/offers", handlers.GetListedOffers)
Expand Down

0 comments on commit 89b4b4e

Please sign in to comment.