Skip to content

Commit ef6dcd8

Browse files
fix(api): bio response
1 parent 0034e52 commit ef6dcd8

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

api/views.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,16 @@ class BiographyEndpoint(APIView):
2121

2222
def get(self, request, format=None):
2323
"""
24-
Returns the bio.
24+
Returns the last bio object created.
2525
"""
2626

27-
biography = Biography.objects.all()
28-
return Response(biography)
27+
biography = Biography.objects.latest(
28+
'created_at')
29+
30+
serialized_bio = {
31+
'title': biography.title,
32+
'subtitle': biography.subtitle,
33+
'description': biography.description
34+
}
35+
36+
return Response(serialized_bio)

0 commit comments

Comments
 (0)