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

Move sort by query parameter to dedicated Parameter section in openapi #95

Open
jcscottiii opened this issue Mar 13, 2024 · 0 comments
Open
Labels
tech-debt Issues that reduce the technical debt of the project typescript Pull requests that update Typescript code

Comments

@jcscottiii
Copy link
Collaborator

Background: #94 (comment)

This will allow us to easily reference the type that is passed in the sort parameter.

Also enable Enum extensions so that frontend can get the generated Enum instead of it trying to maintain its own.

After that, each column can have an Enum assigned to it. And we can modify getSortSpec to return the dedicated Parameter.

export function getSortSpec(location: {search: string}): string {
return getQueryParam(location.search, 'sort');
}

Instead of forcing the string to the type, we can check the query parameter string against the Enum. And then we can do something in case someone passes a bad query parameter by resetting it back to the default name_asc mode.

@jcscottiii jcscottiii added the enhancement New feature or request label May 13, 2024
@jcscottiii jcscottiii added tech-debt Issues that reduce the technical debt of the project typescript Pull requests that update Typescript code and removed enhancement New feature or request labels May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech-debt Issues that reduce the technical debt of the project typescript Pull requests that update Typescript code
Projects
Status: No status
Development

No branches or pull requests

1 participant