feat:add restore project

This commit is contained in:
shahzeydyfah
2024-09-12 14:52:19 +03:30
parent 8c3b50265b
commit fc39ac3eac
2 changed files with 14 additions and 0 deletions
+9
View File
@@ -96,6 +96,15 @@ class ProjectRepository(BaseRepository[ProjectModel]):
}})
return True
async def restore(self, _id: UUID):
old_project = await use_collection(COLLECTION).find_one({"_id":_id})
if not old_project:
raise HTTPException(status_code=400,detail='این پروژه وجود ندارد')
await use_collection(COLLECTION).update_one({"_id":_id},{"$set":{
'sts':1,
}})
return True
async def list_project_design(self):
project = await use_collection(COLLECTION).find({'monitor':{"$exists":0}}).to_list(None)