Skip to content

Commit 0b3be32

Browse files
committed
chore(filer): add filer response code
1 parent 178a4c6 commit 0b3be32

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

rootfs/api/views.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -867,10 +867,13 @@ def get_client(self):
867867
def list(self, request, **kwargs):
868868
path = request.query_params.get('path', '')
869869
client = self.get_client()
870-
results = client.get(path, params={"action": "list"}).json()
871-
# fake out pagination for now
872-
pagination = {'results': results, 'count': len(results)}
873-
return Response(data=pagination)
870+
response = client.get(path, params={"action": "list"})
871+
if response.status_code == 200:
872+
results = response.json()
873+
# fake out pagination for now
874+
pagination = {'results': results, 'count': len(results)}
875+
return Response(data=pagination)
876+
return Response(status=response.status_code, data=response.text)
874877

875878
def retrieve(self, request, **kwargs):
876879
path = self.kwargs.get('path', '')

0 commit comments

Comments
 (0)