@shopgate/engage
Version:
Shopgate's ENGAGE library.
18 lines • 1.38 kB
JavaScript
import{REQUEST_REGISTRATION,SUCCESS_REGISTRATION,ERROR_REGISTRATION,VALIDATION_ERRORS_REGISTRATION}from"../constants";/**
* Creates the dispatched REQUEST_REGISTRATION action object.
* @param {Object} customer The customer data
* @returns {Object} The dispatched action object.
*/export var requestRegistration=function requestRegistration(customer){return{type:REQUEST_REGISTRATION,customer:customer};};/**
* Creates the dispatched SUCCESS_REGISTRATION action object.
* @param {Object} response The pipeline response object
* @returns {Object} The dispatched action object.
*/export var successRegistration=function successRegistration(response){return{type:SUCCESS_REGISTRATION,response:response};};/**
* Creates the dispatched ERROR_REGISTRATION action object.
* @param {Error} error An error object
* @param {Object} customer The customer data
* @returns {Object} The dispatched action object.
*/export var errorRegistration=function errorRegistration(error,customer){return{type:ERROR_REGISTRATION,error:error,customer:customer};};/**
* Creates the dispatched VALIDATION_ERRORS_REGISTRATION action object.
* @param {Array} errors An array of validation errors
* @returns {Object} The dispatched action object.
*/export var validationErrorsRegistration=function validationErrorsRegistration(errors){return{type:VALIDATION_ERRORS_REGISTRATION,errors:errors};};