Skip to content

Instantly share code, notes, and snippets.

@brunomichetti
Created August 21, 2023 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunomichetti/b08ab7902fa08ab8a71f7916b5b6c0dc to your computer and use it in GitHub Desktop.
Save brunomichetti/b08ab7902fa08ab8a71f7916b5b6c0dc to your computer and use it in GitHub Desktop.
# Add this to the action
@extend_schema(
methods=("GET",),
parameters=[OpenApiParameter("username", exclude=True)],
description="Returns the list of users that have at least one user in charge.",
responses=UserListSerializer(many=True),
)
@extend_schema(
methods=("POST",),
description="Receives the id of a user and a leader and sets the leader as leader of the user.",
request=SetLeaderSerializer,
responses=SetLeaderSerializer,
)
@action(detail=False, methods=("GET", "POST",))
def leaders(self, request):
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment