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: setting default "view" query params to "all" #1175

Merged
merged 3 commits into from
Jul 10, 2024

Conversation

npham49
Copy link
Contributor

@npham49 npham49 commented Jul 3, 2024

Issue: #1143

Reasoning behind bug: In the code for getViewData, by default statuses only contains "open", "started" and "planned", since https://fider.io/docs/api#list-posts also uses the same function to generate the sql, the returned posts will only have "open", "started" and "planned" statuses. This conflicts with the documentations.

statuses := []enum.PostStatus{
enum.PostOpen,
enum.PostStarted,
enum.PostPlanned,
}

Proposed changes:
Since the getViewData function is used across the app, updating statuses here might cause problems on other parts of the app, I decided to create a conditional on the route handler for the API to always set the view Query Params to "all" if it is not specified.

@mattwoberts mattwoberts merged commit c9e0674 into getfider:main Jul 10, 2024
8 checks passed
@mattwoberts
Copy link
Contributor

mattwoberts commented Jul 10, 2024

Thanks very much @npham49. - hoping to get a new release out soon so this will be in it :)

@npham49 npham49 deleted the go/apiv1-post-default-view branch July 11, 2024 05:48
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