diff --git a/apiserver/plane/api/urls/asset.py b/apiserver/plane/api/urls/asset.py index 8d1a56b8b..3f8b3b956 100644 --- a/apiserver/plane/api/urls/asset.py +++ b/apiserver/plane/api/urls/asset.py @@ -20,7 +20,7 @@ urlpatterns = [ name="file-assets", ), path( - "//", + "//", AssetsEndpoint.as_view(), name="file-assets", ), diff --git a/apiserver/plane/api/views/asset.py b/apiserver/plane/api/views/asset.py index 3b2537695..d9d7c0336 100644 --- a/apiserver/plane/api/views/asset.py +++ b/apiserver/plane/api/views/asset.py @@ -80,10 +80,10 @@ class AssetsEndpoint(BaseAPIView): permission_classes = [WorkspaceEntityPermission] parser_classes = (MultiPartParser, FormParser) - def get(self, request, workspace_id, asset_key): - - asset_key = str(workspace_id) + "/" + asset_key - file_asset = FileAsset.objects.get(workspace_id=workspace_id,asset=asset_key) + def get(self, request, slug, asset_key): + workspace = Workspace.objects.get(slug=slug) + asset_key = str(workspace.id) + "/" + asset_key + file_asset = FileAsset.objects.get(workspace_id=workspace.id, asset=asset_key) response = StreamingHttpResponse(file_asset.asset.open(mode='rb'), content_type='application/octet-stream') return response