refactor: Mise à jour de la doc swagger / URL

This commit is contained in:
N3WT DE COMPET
2025-02-13 21:59:25 +01:00
parent cce78355a3
commit 4c95b6a83f
13 changed files with 326 additions and 359 deletions

View File

@ -40,8 +40,8 @@ class SessionView(APIView):
try:
decoded_token = jwt.decode(token, settings.SECRET_KEY, algorithms=['HS256'])
print(f'decode : {decoded_token}')
user_id = decoded_token.get('id')
user = Profile.objects.get(id=user_id)
userid = decoded_token.get('id')
user = Profile.objects.get(id=userid)
response_data = {
'user': {
@ -84,7 +84,7 @@ class ProfileSimpleView(APIView):
def put(self, request, id):
data=JSONParser().parse(request)
profil = Profile.objects.get(id=_id)
profil = Profile.objects.get(id=id)
profil_serializer = ProfilUpdateSerializer(profil, data=data)
if profil_serializer.is_valid():
profil_serializer.save()
@ -108,7 +108,7 @@ class LoginView(APIView):
def post(self, request):
data=JSONParser().parse(request)
validatorAuthentication = validator.ValidatorAuthentication(data=data)
retour = error.returnMessage[error.WRONG_ID]
retour = error.returnMessage[error.WRONGid]
validationOk, errorFields = validatorAuthentication.validate()
user = None
if validationOk:
@ -133,7 +133,7 @@ class LoginView(APIView):
# 'role': "admin"
# }, settings.SECRET_KEY, algorithm='HS256')
else:
retour = error.returnMessage[error.WRONG_ID]
retour = error.returnMessage[error.WRONGid]
return JsonResponse({