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

Kl 2021 11 more propsal api filters #4014

Merged
merged 2 commits into from
Dec 2, 2021
Merged

Conversation

fuzzylogic2000
Copy link
Contributor

This does the filtering. But we need to know which categories to display (and their icons).
What is the best way to add that? I think previously we either added that to the template tag or to the serializer. But I guess the best option would be to add it to the response.data of the API, which should be possible? What do you think @Rineee ?

add category=<category_pk> and / or is_archived=true or false as url parameter
to get all propsals, either remove the parameter or add it as empty parameter "category="
@github-actions
Copy link

github-actions bot commented Dec 1, 2021

Coverage report

Total coverage

Status Category Percentage Covered / Total
🔴 Statements 3.14% 39/1242
🔴 Branches 2.93% 21/716
🔴 Functions 4.15% 17/410
🔴 Lines 6.79% 248/3654

Status of coverage: 🟢 - ok, 🟡 - slightly more than threshold, 🔴 - under the threshold

Report generated by 🧪jest coverage report action from 7a80cea

@fuzzylogic2000
Copy link
Contributor Author

This does the filtering. But we need to know which categories to display (and their icons). What is the best way to add that? I think previously we either added that to the template tag or to the serializer. But I guess the best option would be to add it to the response.data of the API, which should be possible? What do you think @Rineee ?

And wherever we put the category choices, the moderator feedback choices should also go there. (Or of course stay where they are and we also put the category choices there.)

def get_moderator_feedback_choices(self, proposal):
What do we actually need them for, though?

@khamui
Copy link
Contributor

khamui commented Dec 2, 2021

This does the filtering. But we need to know which categories to display (and their icons). What is the best way to add that? I think previously we either added that to the template tag or to the serializer. But I guess the best option would be to add it to the response.data of the API, which should be possible? What do you think @Rineee ?

And wherever we put the category choices, the moderator feedback choices should also go there. (Or of course stay where they are and we also put the category choices there.)

def get_moderator_feedback_choices(self, proposal):

What do we actually need them for, though?

yes i was not sure where to add the choices best.
It is used here:

return props.moderatorChoices.find(choice => {

@khamui
Copy link
Contributor

khamui commented Dec 2, 2021

yeah nice! can be filtered on the api

@khamui khamui merged commit 241765c into main Dec 2, 2021
@khamui khamui deleted the kl-2021-11-more-propsal-api-filters branch December 2, 2021 10:27
@Rineee
Copy link
Contributor

Rineee commented Dec 2, 2021

@fuzzylogic2000 @khamui I will look into where/how to add the choices best!

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.

None yet

3 participants