custom attribute added
This commit is contained in:
parent
b435ce7b18
commit
51b3779ad1
|
@ -142,7 +142,7 @@ export const doUpdateAddress = meWrapRequest((one, address) => {
|
|||
};
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/customers/me`, requestOptions)
|
||||
});
|
||||
export const doUpdateUserAddress = meWrapRequest((one, addresses) => {
|
||||
export const doUpdateUserAddress = meWrapRequest((one, addresses,customerNumber) => {
|
||||
const requestOptions = {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
|
@ -157,7 +157,12 @@ export const doUpdateUserAddress = meWrapRequest((one, addresses) => {
|
|||
"website_id": one.websiteId,
|
||||
"addresses": addresses,
|
||||
"default_shipping": one.defaultShipping,
|
||||
"default_billing": one.defaultBilling
|
||||
"default_billing": one.defaultBilling,
|
||||
"custom_attributes": [
|
||||
{
|
||||
"attribute_code": "customer_number",
|
||||
"value": customerNumber
|
||||
}]
|
||||
}
|
||||
})
|
||||
};
|
||||
|
@ -185,7 +190,7 @@ export const doUpdateSubscription = meWrapRequest((one) => {
|
|||
};
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/customers/retailer`, requestOptions)
|
||||
});
|
||||
export const doChangeBasicInfo = meWrapRequest((one) => {
|
||||
export const doChangeBasicInfo = meWrapRequest((one,customerNumber) => {
|
||||
const requestOptions = {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
|
@ -197,7 +202,12 @@ export const doChangeBasicInfo = meWrapRequest((one) => {
|
|||
"firstname": one.firstname,
|
||||
"lastname": one.lastname,
|
||||
"email": one.email,
|
||||
"website_id": one.websiteId
|
||||
"website_id": one.websiteId,
|
||||
"custom_attributes": [
|
||||
{
|
||||
"attribute_code": "customer_number",
|
||||
"value": customerNumber
|
||||
}]
|
||||
}
|
||||
})
|
||||
};
|
||||
|
|
|
@ -351,7 +351,7 @@ export const accountOne = {
|
|||
commit('inProgress', true);
|
||||
commit('updateAddresses', state.address);
|
||||
commit('formatAddresses');
|
||||
const basicInfo = await doUpdateUserAddress(state.one, state.addresses);
|
||||
const basicInfo = await doUpdateUserAddress(state.one, state.addresses,state.customerNumber);
|
||||
if (basicInfo) {
|
||||
//commit('successMessage', 'Address Updated Successfully');
|
||||
commit('inProgress', false);
|
||||
|
@ -379,7 +379,7 @@ export const accountOne = {
|
|||
commit('inProgress', true);
|
||||
try {
|
||||
if (passwords == undefined) {
|
||||
const basicInfo = await doChangeBasicInfo(state.one);
|
||||
const basicInfo = await doChangeBasicInfo(state.one,state.customerNumber);
|
||||
if (basicInfo) {
|
||||
commit('inProgress', false);
|
||||
//commit('successMessage', 'Updated Basic Information Successfully');
|
||||
|
@ -388,7 +388,7 @@ export const accountOne = {
|
|||
} else {
|
||||
const changedPassword = await doChangePassword(passwords.current, passwords.new);
|
||||
if (changedPassword) {
|
||||
const basicInfo = await doChangeBasicInfo(state.one);
|
||||
const basicInfo = await doChangeBasicInfo(state.one,state.customerNumber);
|
||||
commit('inProgress', false);
|
||||
//commit('successMessage', 'Updated Basic Information Successfully');
|
||||
commit('setOne', humps(basicInfo));
|
||||
|
@ -492,7 +492,7 @@ export const accountOne = {
|
|||
try {
|
||||
commit('deleteAddress', address);
|
||||
commit('formatAddresses');
|
||||
const basicInfo = await doUpdateUserAddress(state.one, state.addresses);
|
||||
const basicInfo = await doUpdateUserAddress(state.one, state.addresses,state.customerNumber);
|
||||
if (basicInfo) {
|
||||
//commit('successMessage', 'Address Updated Successfully');
|
||||
commit('fetchInProgress', false);
|
||||
|
|
Loading…
Reference in New Issue