change
This commit is contained in:
@@ -26,9 +26,13 @@ class ProductCreateApiView(generics.GenericAPIView):
|
||||
def post(self, request):
|
||||
serializer = self.serializer_class(data=request.data)
|
||||
if serializer.is_valid(raise_exception=True):
|
||||
serializer.save()
|
||||
data = serializer.save()
|
||||
return Response(
|
||||
{'success': True, 'message': "product successfully created!"},
|
||||
{
|
||||
'success': True,
|
||||
'message': "product successfully created!",
|
||||
'product': self.serializer_class(data)
|
||||
},
|
||||
status=201
|
||||
)
|
||||
return Response(
|
||||
|
||||
Reference in New Issue
Block a user