Пример #1
0
 def delete(cls, user_id: int):
     user = UserModel.find_by_id(user_id)
     if not user:
         return {"message": USER_NOT_FOUND}, 404
     user.delete_from_db()
     return {"message": USER_DELETED}, 200
Пример #2
0
 def get(cls, user_id: int):
     user = UserModel.find_by_id(user_id)
     if not user:
         return {"message": USER_NOT_FOUND}, 404
     return user.json(), 200