June 2014
Intermediate to advanced
696 pages
38h 52m
English
Listing 28.11 implements the route handling code for the Customer model. There are four routes. The getCustomer() route finds a customer order, based on the hard-coded customerA value. If it is successful, the Customer object is returned to the client as JSON strings. If the request fails, a 404 error is returned. The updateShipping() route creates a new Address object from the updatedShipping parameter in the POST request and then uses an update() method to update the Customer object with the new shipping data. If it is successful, a success message is returned; if it fails, a 404 error is returned.
The updateBilling() route creates a new Billing object from the updatedBilling parameter in the POST ...
Read now
Unlock full access