Skip to content

Commit

Permalink
implement recipe filter feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Benji918 committed Oct 2, 2023
1 parent 988aa2c commit 36d30e8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions app/recipe/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Views for the recipe APIs"""

from core.models import Recipe, Tag, Ingredient
from drf_spectacular.utils import extend_schema_view, extend_schema, OpenApiParameter, OpenApiTypes
from rest_framework import viewsets, mixins, status
from rest_framework.authentication import TokenAuthentication
from rest_framework.decorators import action
Expand All @@ -12,6 +13,23 @@


# Create your views here.

@extend_schema_view(
list=extend_schema(
parameters=[
OpenApiParameter(
'tags',
OpenApiTypes.STR,
description='Comma separated list of IDs to filter',
),
OpenApiParameter(
'ingredients',
OpenApiTypes.STR,
description='Comma separated list of IDs to filter',
)
]
)
)
class RecipeViewSets(viewsets.ModelViewSet):
"""View for manage recipe APIs."""
serializer_class = RecipeDetailSerializer
Expand Down

0 comments on commit 36d30e8

Please sign in to comment.