From 896df5776f79bc36dca0ca740b17802a63307ee1 Mon Sep 17 00:00:00 2001 From: Chandrapal Badshah <12944530+Chan9390@users.noreply.github.com> Date: Wed, 30 Apr 2025 15:12:45 +0530 Subject: [PATCH] Remove update and destroy CRUD methods --- api/src/backend/api/v1/views.py | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/api/src/backend/api/v1/views.py b/api/src/backend/api/v1/views.py index f3ea6d10a4..c6bc3d576a 100644 --- a/api/src/backend/api/v1/views.py +++ b/api/src/backend/api/v1/views.py @@ -2782,7 +2782,7 @@ class IntegrationViewSet(BaseRLSViewSet): class LighthouseConfigViewSet(BaseRLSViewSet): """ - API endpoint for managing OpenAI API configuration. + API endpoint for managing Lighthouse configuration. """ filterset_fields = { @@ -2835,7 +2835,7 @@ class LighthouseConfigViewSet(BaseRLSViewSet): ) def create(self, request, *args, **kwargs): - """Create new AI configuration""" + """Create new Lighthouse configuration""" serializer = self.get_serializer(data=request.data) serializer.is_valid(raise_exception=True) instance = serializer.save() @@ -2849,22 +2849,10 @@ class LighthouseConfigViewSet(BaseRLSViewSet): headers=headers, ) - def update(self, request, *args, **kwargs): - """Update existing AI configuration""" - instance = self.get_object() - serializer = self.get_serializer(instance, data=request.data) - serializer.is_valid(raise_exception=True) - instance = serializer.save() - return Response( - LighthouseConfigSerializer( - instance, context=self.get_serializer_context() - ).data - ) - @action(detail=True, methods=["get"], url_path="show_key") def show_key(self, request, pk=None): """ - Return the decrypted API key for the specified AI configuration. + Return the decrypted API key for the specified Lighthouse configuration. """ instance = self.get_object() @@ -2895,12 +2883,3 @@ class LighthouseConfigViewSet(BaseRLSViewSet): }, status=status.HTTP_500_INTERNAL_SERVER_ERROR, ) - - def destroy(self, request, *args, **kwargs): - """Delete AI configuration""" - instance = self.get_object() - - # Perform deletion - self.perform_destroy(instance) - - return Response(status=status.HTTP_204_NO_CONTENT)