윤창목

commit fixed views.py

......@@ -398,6 +398,7 @@ class ItemViewSet(viewsets.ViewSet):
# 파일 객체 생성
file_name = request.POST.get('name', '')
file_size = request.POST.get('size', '')
file_id = request.POST.get('item_id', '')
file_parent = pk
file_type = mimetypes.guess_type(file_name)[0]
upload_item = Item(name=file_name, size=file_size, user_id=1, file_type=file_type, parent=file_parent)
......@@ -407,7 +408,7 @@ class ItemViewSet(viewsets.ViewSet):
presigned_post = s3.generate_presigned_post(
s3_bucket,
file_name,
file_id,
{
"acl": "private",
"Content-Type": file_type,
......@@ -434,7 +435,7 @@ class ItemViewSet(viewsets.ViewSet):
data = {
"signed_url": presigned_post,
'url': '%s/%s' % (presigned_post["url"], file_name),
'url': '%s/%s' % (presigned_post["url"], file_id),
'item': res
}
......@@ -491,4 +492,4 @@ class SharedItemViewSet(viewsets.ModelViewSet):
item = ItemViewSet.as_view({
'delete': 'destroy',
})
\ No newline at end of file
})
......