mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-23 06:49:37 +02:00
New AdventureModal Accordian
This commit is contained in:
parent
c6ecfca91d
commit
6cb31aa125
7 changed files with 291 additions and 245 deletions
|
@ -105,6 +105,9 @@ class AdventureViewSet(viewsets.ModelViewSet):
|
|||
@action(detail=False, methods=['get'])
|
||||
def filtered(self, request):
|
||||
types = request.query_params.get('types', '').split(',')
|
||||
# handle case where types is all
|
||||
if 'all' in types:
|
||||
types = [t[0] for t in ADVENTURE_TYPES]
|
||||
valid_types = [t[0] for t in ADVENTURE_TYPES]
|
||||
types = [t for t in types if t in valid_types]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue