This commit is contained in:
wuaho 2021-12-01 16:32:37 +08:00
parent 15b4404c45
commit 0313fba151

View File

@ -40,7 +40,7 @@ async def edit(
"""编辑报表"""
res = await crud.report.update_one(db, {'_id': data_in.report_id, 'user_id': request.user.id},
{'$set': {'query': data_in.query, 'name': data_in.name, 'desc': data_in.desc}})
if not res.modified_count:
if not res.matched_count:
return schemas.Msg(code=-1, msg='只能报表所有者编辑')
return schemas.Msg(code=0, msg='ok', data='编辑成功')