Showing
2 changed files
with
6 additions
and
5 deletions
... | @@ -33,6 +33,7 @@ def list_item(request): | ... | @@ -33,6 +33,7 @@ def list_item(request): |
33 | data.append({ | 33 | data.append({ |
34 | 'id': file.id, | 34 | 'id': file.id, |
35 | 'type': file.type, | 35 | 'type': file.type, |
36 | + 'parent_id': file.parent_id, | ||
36 | 'name': file.name, | 37 | 'name': file.name, |
37 | 'size': file.size, | 38 | 'size': file.size, |
38 | 'is_public': file.is_public, | 39 | 'is_public': file.is_public, |
... | @@ -141,10 +142,6 @@ def empty_trash(request): | ... | @@ -141,10 +142,6 @@ def empty_trash(request): |
141 | 142 | ||
142 | # 폴더/파일 조회 | 143 | # 폴더/파일 조회 |
143 | def find_item(request, file_id): | 144 | def find_item(request, file_id): |
144 | - # Check Login | ||
145 | - if request.user_id is None: | ||
146 | - return {'result': False, 'error': '로그인을 해주세요.'} | ||
147 | - | ||
148 | # Query | 145 | # Query |
149 | file = File.objects.filter(id=file_id, deleted_at__isnull=True) | 146 | file = File.objects.filter(id=file_id, deleted_at__isnull=True) |
150 | 147 | ||
... | @@ -174,13 +171,14 @@ def find_item(request, file_id): | ... | @@ -174,13 +171,14 @@ def find_item(request, file_id): |
174 | 171 | ||
175 | # Check Auth | 172 | # Check Auth |
176 | if is_auth is False: | 173 | if is_auth is False: |
177 | - return {'result': False, 'error': '잘못된 요청입니다.'} | 174 | + return {'result': False, 'error': '권한이 없습니다.'} |
178 | 175 | ||
179 | # Return File | 176 | # Return File |
180 | if file[0].type == 'file': | 177 | if file[0].type == 'file': |
181 | download_url = sign_download(file[0].id) | 178 | download_url = sign_download(file[0].id) |
182 | data = { | 179 | data = { |
183 | 'id': file[0].id, | 180 | 'id': file[0].id, |
181 | + 'type': file[0].type, | ||
184 | 'parent_id': file[0].parent_id, | 182 | 'parent_id': file[0].parent_id, |
185 | 'name': file[0].name, | 183 | 'name': file[0].name, |
186 | 'size': file[0].size, | 184 | 'size': file[0].size, |
... | @@ -198,6 +196,7 @@ def find_item(request, file_id): | ... | @@ -198,6 +196,7 @@ def find_item(request, file_id): |
198 | # Structure | 196 | # Structure |
199 | data = { | 197 | data = { |
200 | 'id': file[0].id, | 198 | 'id': file[0].id, |
199 | + 'type': file[0].type, | ||
201 | 'parent_id': file[0].parent_id, | 200 | 'parent_id': file[0].parent_id, |
202 | 'name': file[0].name, | 201 | 'name': file[0].name, |
203 | 'size': file[0].size, | 202 | 'size': file[0].size, |
... | @@ -211,6 +210,7 @@ def find_item(request, file_id): | ... | @@ -211,6 +210,7 @@ def find_item(request, file_id): |
211 | file_list.append({ | 210 | file_list.append({ |
212 | 'id': file.id, | 211 | 'id': file.id, |
213 | 'type': file.type, | 212 | 'type': file.type, |
213 | + 'parent_id': file.parent_id, | ||
214 | 'name': file.name, | 214 | 'name': file.name, |
215 | 'size': file.size, | 215 | 'size': file.size, |
216 | 'is_public': file.is_public, | 216 | 'is_public': file.is_public, | ... | ... |
... | @@ -149,6 +149,7 @@ def find_item(request, group_id): | ... | @@ -149,6 +149,7 @@ def find_item(request, group_id): |
149 | 'id': group[0].id, | 149 | 'id': group[0].id, |
150 | 'name': group[0].name, | 150 | 'name': group[0].name, |
151 | 'root_folder': group[0].root_folder, | 151 | 'root_folder': group[0].root_folder, |
152 | + 'is_owner': False, | ||
152 | } | 153 | } |
153 | 154 | ||
154 | # If Owner | 155 | # If Owner | ... | ... |
-
Please register or login to post a comment