I'm using django and djangorestframwork and drf-yasg.
I have this api in view.py
module:
@api_view(http_method_names=["GET"])
def get_all__referralCodes_game(request):
data = request.query_params
query = GameCollection.find_one(
{"_id": ObjectId(data["gameId"]),},
{"_id": 0,f"referralCodes": 1,}
)
if query:
return Response(data={"msg": "ok", "data": [query["referralCodes"]]}, status=http.HTTPStatus.OK)
return Response(data={"msg": "not_found", "data": {}}, status=http.HTTPStatus.NOT_FOUND)
and in url.py
module I have:
urlpatterns = [
path("referral-code/get-all", views.get_all__referralCodes_game),
]
I need to have gameId
in query params but it can not be seen there.