diff --git a/apiserver/plane/api/serializers/importer.py b/apiserver/plane/api/serializers/importer.py index 28f2153c8..fcc7da6ce 100644 --- a/apiserver/plane/api/serializers/importer.py +++ b/apiserver/plane/api/serializers/importer.py @@ -1,11 +1,13 @@ # Module imports from .base import BaseSerializer from .user import UserLiteSerializer +from .project import ProjectLiteSerializer from plane.db.models import Importer class ImporterSerializer(BaseSerializer): initiated_by_detail = UserLiteSerializer(source="initiated_by", read_only=True) + project_detail = ProjectLiteSerializer(source="project", read_only=True) class Meta: model = Importer diff --git a/apiserver/plane/api/views/importer.py b/apiserver/plane/api/views/importer.py index dd52d2dd2..15ff20f55 100644 --- a/apiserver/plane/api/views/importer.py +++ b/apiserver/plane/api/views/importer.py @@ -213,8 +213,10 @@ class ImportServiceEndpoint(BaseAPIView): def get(self, request, slug): try: - imports = Importer.objects.filter(workspace__slug=slug).order_by( - "-created_at" + imports = ( + Importer.objects.filter(workspace__slug=slug) + .order_by("-created_at") + .select_related("initiated_by", "project", "workspace") ) serializer = ImporterSerializer(imports, many=True) return Response(serializer.data)