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

Add more valid filters for query to /sessions endpoint #97

Merged
merged 3 commits into from
Dec 29, 2023

Conversation

gwynndp
Copy link
Collaborator

@gwynndp gwynndp commented Nov 15, 2023

Necessary change to allow filtering by session in the admin client.

Related to PR in query api: Greenstand/treetracker-query-api#276

@gwynndp gwynndp marked this pull request as draft November 15, 2023 00:13
@gwynndp gwynndp marked this pull request as ready for review December 12, 2023 23:10
@gwynndp gwynndp marked this pull request as draft December 12, 2023 23:10
server/handlers/sessionHandler/schemas.js Outdated Show resolved Hide resolved
server/handlers/sessionHandler/index.js Outdated Show resolved Hide resolved
server/infra/database/knex.js Outdated Show resolved Hide resolved
server/repositories/RawCaptureRepository.js Outdated Show resolved Hide resolved
formatKeys(filter) {
return Object.entries(filter).reduce((obj, [key, val]) => {
const copy = { ...obj };
if (this._wrKeys.includes(key)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can set the key to wallet_registrations rather than _wrKeys and then having to reformat it

Copy link
Collaborator Author

@gwynndp gwynndp Dec 21, 2023

Choose a reason for hiding this comment

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

I'm not sure I understand your advice, can you please clarify?

Those particular keys need to be designated as related to the wallet_registrations table for the query to work. We could do a simple conditional to rename them, but addTableNames could be a utility fn() since we need to do similar transformations for getting the session count.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I meant just renaming '_wrkeys' to '_walletRegistrationKeys'

@gwynndp gwynndp marked this pull request as ready for review December 23, 2023 00:07
@gwynndp gwynndp requested a review from Kpoke December 23, 2023 00:07
@Kpoke Kpoke merged commit 18fce77 into Greenstand:main Dec 29, 2023
1 check passed
Copy link

🎉 This PR is included in version 1.13.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants