瀏覽代碼

adjust nft owner from

conradlan 3 年之前
父節點
當前提交
14cf7358c2
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/api/api_v1/endpoints/nft.py

+ 2 - 2
app/api/api_v1/endpoints/nft.py

@@ -53,7 +53,7 @@ async def create_item(
         raise HTTPException(status_code=415, detail='content type error! Please upload valid image type')
     filename = str(uuid4()) + '.' + image.content_type.split('/')[1]
     with open(settings.IMG_PATH + filename, 'wb+') as f:
-        await f.write(image.file.read())
+        f.write(image.file.read())
         f.close()
     item_in = schemas.NftCreate
     item_in.hash = hash
@@ -64,7 +64,7 @@ async def create_item(
     item_in.category = catagory
     item_in.imgurl = settings.IMG_HOST + filename
     nft = crud.nft.create_with_owner(
-        db=db, obj_in=item_in, owner_id=current_user.userid)
+        db=db, obj_in=item_in, owner_id=item_in.userid)
     return nft