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
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