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'}
def get(self, id): """Get user by id""" user = UserModel.fetch_all(id) return users_schema.dump(user), 200
def get(self): """Use this Endpoint to get all users""" users = UserModel.fetch_all() return users_schema.dump(users), 200