chore: make module create and list endpoint response structure simillar (#2524)
This commit is contained in:
parent
55b2927a17
commit
c8f98a9bc2
1 changed files with 3 additions and 0 deletions
|
|
@ -149,6 +149,9 @@ class ModuleViewSet(BaseViewSet):
|
|||
|
||||
if serializer.is_valid():
|
||||
serializer.save()
|
||||
|
||||
module = Module.objects.get(pk=serializer.data["id"])
|
||||
serializer = ModuleSerializer(module)
|
||||
return Response(serializer.data, status=status.HTTP_201_CREATED)
|
||||
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue