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

fix translation methods between query pages #214

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

fzhao99
Copy link
Collaborator

@fzhao99 fzhao99 commented Dec 12, 2024

PULL REQUEST

Summary

The code that just went in for the new DB tables overloaded a mapping method between @katyasoup and I's PR's that should have been two separate functions. This PR separates them and adds some unit tests to prevent this in the future

Additional Information

Another example of us not having testing infra biting us! Will bring this up at retro

Something else that might have caught this earlier would be more explicitly typing the response from the DB beyond the provided QueryRow. Would love opinions on how we might type our queries more explicitly to tell application code what the shape of data coming back from the DB looks like

Checklist

  • Descriptive Pull Request title
  • Update documentation

@@ -688,8 +688,7 @@ export async function getCustomQueries(): Promise<CustomUserQuery[]> {
q.query_data,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we can just return all the entries in the query table now that we only seed the table with the five demo queries

@fzhao99 fzhao99 marked this pull request as ready for review December 12, 2024 20:14
return {
code: c["code"],
display: c["display"],
include: c["include"] ?? true,
Copy link
Collaborator Author

@fzhao99 fzhao99 Dec 12, 2024

Choose a reason for hiding this comment

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

In the query building flow, we were getting undefined in a bunch of places since c["include"] wasn't natively there. I think the contexts where include isn't defined off the concept group, the default when we're making a trip back from the DB should be true since we want to include any concept that we've fetched.

If folks think differently though happy to change this

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.

2 participants