gathering / unicorn-backend

Backend/API for UNICORN
https://competitions.gathering.org
MIT License
2 stars 1 forks source link

Add support for filtering Award view based on user and achievement #22

Closed niccofyren closed 2 years ago

niccofyren commented 2 years ago

Super useful when wanting to interact with already awarded achievements.

Allows us to show all awards for a given user and achievement combo: /api/achivements/awards/?user=<userid>&achievement=<achievementid>

Making it a lot easier to then DELETE or PUT an existing award/"user achievement".

eriktm commented 2 years ago

Check out the django_filter docs on generating filters based on model fields. This is probably better to avoid specifying the filter types manually.

FYI: It is already possible to list Achievements per user on /api/achievements/achievements/?user=$uuid, if that's the goal.

niccofyren commented 2 years ago

Thanks for the docs, will take a look (just "copy pasted" approach from another filter.

Yeah, in this case we are interested in awards, not achievements.

eriktm commented 2 years ago

Closing this as achievements is not part of unicorn anymore.