chore: response status for project views update (#2111)

* chore: response status for project views update

* dev: remove 200 OK response from empty contents
This commit is contained in:
Nikhil 2023-09-07 14:49:45 +05:30 committed by GitHub
parent 5989f2476a
commit 8ba482bc9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -482,7 +482,7 @@ class UserProjectInvitationsViewset(BaseViewSet):
# Delete joined project invites # Delete joined project invites
project_invitations.delete() project_invitations.delete()
return Response(status=status.HTTP_200_OK) return Response(status=status.HTTP_204_NO_CONTENT)
except Exception as e: except Exception as e:
capture_exception(e) capture_exception(e)
return Response( return Response(
@ -924,8 +924,7 @@ class ProjectUserViewsEndpoint(BaseAPIView):
project_member.save() project_member.save()
return Response(status=status.HTTP_200_OK) return Response(status=status.HTTP_204_NO_CONTENT)
except Project.DoesNotExist: except Project.DoesNotExist:
return Response( return Response(
{"error": "The requested resource does not exists"}, {"error": "The requested resource does not exists"},

View File

@ -532,7 +532,7 @@ class UserWorkspaceInvitationsEndpoint(BaseViewSet):
# Delete joined workspace invites # Delete joined workspace invites
workspace_invitations.delete() workspace_invitations.delete()
return Response(status=status.HTTP_200_OK) return Response(status=status.HTTP_204_NO_CONTENT)
except Exception as e: except Exception as e:
capture_exception(e) capture_exception(e)
return Response( return Response(
@ -846,7 +846,7 @@ class WorkspaceMemberUserViewsEndpoint(BaseAPIView):
workspace_member.view_props = request.data.get("view_props", {}) workspace_member.view_props = request.data.get("view_props", {})
workspace_member.save() workspace_member.save()
return Response(status=status.HTTP_200_OK) return Response(status=status.HTTP_204_NO_CONTENT)
except WorkspaceMember.DoesNotExist: except WorkspaceMember.DoesNotExist:
return Response( return Response(
{"error": "User not a member of workspace"}, {"error": "User not a member of workspace"},