Exemple #1
0
 def delete(self, id):
     """Delete user by id"""
     user = UserModel.fetch_all(id)
     if user:
         user.delete_from_db()
         return {"Message": 'User Deleted Successfully'}
     else:
         return {"Message": 'The User does not exist'}
Exemple #2
0
 def get(self, id):
     """Get user by id"""
     user = UserModel.fetch_all(id)
     return users_schema.dump(user), 200
Exemple #3
0
 def get(self):
     """Use this Endpoint to get all users"""
     users = UserModel.fetch_all()
     return users_schema.dump(users), 200