예제 #1
0
 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)
예제 #2
0
 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)