Skip to content

Commit

Permalink
fix: backend api
Browse files Browse the repository at this point in the history
  • Loading branch information
Shavkatjon-O committed Aug 23, 2024
1 parent 23f2dcd commit a736f39
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
18 changes: 18 additions & 0 deletions apps/users/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,21 @@ class Meta:
"skills",
"image",
)


class UserUpdateSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = (
"first_name",
"last_name",
"phone_number",
"date_of_birth",
"address",
"job_title",
"department",
"education",
"employment_start_date",
"skills",
"image",
)
8 changes: 6 additions & 2 deletions apps/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
from rest_framework.permissions import AllowAny

from django.contrib.auth import get_user_model
from apps.users.serializers import SignupSerializer, UserSerializer
from apps.users.serializers import (
SignupSerializer,
UserSerializer,
UserUpdateSerializer,
)


User = get_user_model()
Expand All @@ -25,7 +29,7 @@ def get_object(self):

class UserDetailUpdateView(generics.UpdateAPIView):
queryset = User.objects.all()
serializer_class = UserSerializer
serializer_class = UserUpdateSerializer

def get_object(self):
return self.request.user

0 comments on commit a736f39

Please sign in to comment.