-
Notifications
You must be signed in to change notification settings - Fork 0
/
cnUpdateAccountBefore.js
31 lines (24 loc) · 1.03 KB
/
cnUpdateAccountBefore.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* Implementation for http.commerce.customer.accounts.updateAccount.before
* HTTP Actions all receive a similar context object that includes
* `request` and `response` objects. These objects are similar to
* http.IncomingMessage objects in NodeJS.
{
configuration: {},
request: http.ClientRequest,
response: http.ClientResponse
}
* Call `response.end()` to end the response early.
* Call `response.set(headerName)` to set an HTTP header for the response.
* `request.headers` is an object containing the HTTP headers for the request.
*
* The `request` and `response` objects are both Streams and you can read
* data out of them the way that you would in Node.
*/
var CustomerService = require('../customerservice');
module.exports = function(context, callback) {
var customerAccount = context.request.params.account;
console.log ("Update Customer Account Action...the Customer:", customerAccount);
var customerService = new CustomerService(context, callback);
customerService.updateCustomerCheck(customerAccount);
};