Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor TestGetPersonByPuKey To Use A Real Postgres DB For The Test #1715

Merged

Conversation

MuhammadUmer44
Copy link
Contributor

Describe your changes

image

Issue ticket number and link

Closes: #1713

Checklist before requesting a review

  • Bug fix (non-breaking change which fixes an issue)
  • I have performed a self-review of my code
  • I have tested on Chrome and Firefox
  • I have provided a screenshot or recording of changes in my PR if there were updates to the frontend

rctx := chi.NewRouteContext()
rctx.URLParams.Add("pubkey", "person-pub-key")
req, err := http.NewRequestWithContext(context.WithValue(context.Background(), chi.RouteCtxKey, rctx), http.MethodGet, "/person/person-pub-key", nil)
rctx.URLParams.Add("pubkey", "person_104_pubkey")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MuhammadUmer44 please use the variable person.OwnerPubkey here, this will help for an easy change in the future, and you don't need to reuse the same string when it is already on a variable.

		rctx.URLParams.Add("pubkey", person.OwnerPubkey)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MuhammadUmer44 please use the variable person.OwnerPubkey here, this will help for an easy change in the future, and you don't need to reuse the same string when it is already on a variable.

		rctx.URLParams.Add("pubkey", person.OwnerPubkey)

also use the person.OwnerPubkey on the route.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elraphty Fixed.

@MuhammadUmer44 MuhammadUmer44 requested a review from elraphty June 20, 2024 17:38
@MuhammadUmer44
Copy link
Contributor Author

Hi @elraphty, Please review this PR.

@elraphty elraphty merged commit bbd6c92 into stakwork:master Jun 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor TestGetPersonByPuKey To Use A Real Postgres DB For The Test
2 participants