feat:add restore project
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user