Builds for
2 pipelines
passed
in
64 minutes 45 seconds
feat: additional information when directory
before, only files in directory was shown in directory view api api to pointing parent folder id, current folder name needed
Showing
1 changed file
with
13 additions
and
3 deletions
... | @@ -196,9 +196,19 @@ def find_item(request, file_id): | ... | @@ -196,9 +196,19 @@ def find_item(request, file_id): |
196 | files = File.objects.filter(parent_id=file[0].id, is_trashed=0, deleted_at__isnull=True) | 196 | files = File.objects.filter(parent_id=file[0].id, is_trashed=0, deleted_at__isnull=True) |
197 | 197 | ||
198 | # Structure | 198 | # Structure |
199 | - data = [] | 199 | + data = { |
200 | + 'id': file[0].id, | ||
201 | + 'parent_id': file[0].parent_id, | ||
202 | + 'name': file[0].name, | ||
203 | + 'size': file[0].size, | ||
204 | + 'is_public': file[0].is_public, | ||
205 | + 'is_starred': file[0].is_starred, | ||
206 | + 'is_trashed': file[0].is_trashed, | ||
207 | + 'created_at': file[0].created_at, | ||
208 | + } | ||
209 | + file_list = [] | ||
200 | for file in files: | 210 | for file in files: |
201 | - data.append({ | 211 | + file_list.append({ |
202 | 'id': file.id, | 212 | 'id': file.id, |
203 | 'type': file.type, | 213 | 'type': file.type, |
204 | 'name': file.name, | 214 | 'name': file.name, |
... | @@ -210,7 +220,7 @@ def find_item(request, file_id): | ... | @@ -210,7 +220,7 @@ def find_item(request, file_id): |
210 | }) | 220 | }) |
211 | 221 | ||
212 | # Return Folder | 222 | # Return Folder |
213 | - return {'result': True, 'data': data} | 223 | + return {'result': True, 'data': data, 'files': file_list} |
214 | 224 | ||
215 | 225 | ||
216 | # 폴더/파일 수정 | 226 | # 폴더/파일 수정 | ... | ... |
-
Please register or login to post a comment