def put(self, email): """ Update a consumer by email. """ token = request.headers.get('Authorization') auth = Validations.validate_user_authorization(token) json_data = request.json data_valid = Validations.customer_validate(json_data) return CustomerManager.update_existing_customer(email, json_data)
def post(self): """ Register a new customer. """ token = request.headers.get('Authorization') auth = Validations.validate_user_authorization(token) json_data = request.json validation = Validations.customer_validate(json_data) return CustomerManager.register_new_customer(json_data)