def post(self, current_user: User) -> Job: job = self.controller.create(current_user) serialized_job = serialize(job, get_job_fields()) json_job = json.dumps(serialized_job) response = get_post_response(obj=job, body=json_job, content_type='application/json', api='/{rsc}'.format(rsc=API_PREFIX)) return response
def post(self, current_user: User) -> User: user = self.controller.create(current_user) serialized_user = serialize(user, get_registered_user_details()) json_user = json.dumps(serialized_user) response = get_post_response(obj=user, body=json_user, content_type='application/json', api='/{rsc}'.format(rsc=API_PREFIX)) return response
def post(self, current_user: User) -> CoffeeType: coffee_type = self.controller.create(current_user) serialized_coffee_type = serialize(coffee_type, get_coffee_type_fields()) json_coffee_type = json.dumps(serialized_coffee_type) response = get_post_response(obj=coffee_type, body=json_coffee_type, content_type='application/json', api='/{rsc}/types'.format(rsc=API_PREFIX)) return response
def post(self): new_user = self.controller.create() serialized_user = serialize(new_user, get_registered_user_details()) json_user = json.dumps(serialized_user) response = get_post_response( obj=new_user, body=json_user, content_type='application/json', api='/public/{rsc}'.format(rsc=API_PREFIX)) return response
def post(self, current_user: User) -> Profile: profile = self.controller.create(current_user) serialized_profile = serialize(profile, get_profile_fields()) json_profile = json.dumps(serialized_profile) response = get_post_response( obj=profile, body=json_profile, content_type='application/json', api='/{rsc}/current/profiles'.format(rsc=API_PREFIX)) return response