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)
|
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 = {
|
const requestOptions = {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -157,7 +157,12 @@ export const doUpdateUserAddress = meWrapRequest((one, addresses) => {
|
||||||
"website_id": one.websiteId,
|
"website_id": one.websiteId,
|
||||||
"addresses": addresses,
|
"addresses": addresses,
|
||||||
"default_shipping": one.defaultShipping,
|
"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)
|
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/customers/retailer`, requestOptions)
|
||||||
});
|
});
|
||||||
export const doChangeBasicInfo = meWrapRequest((one) => {
|
export const doChangeBasicInfo = meWrapRequest((one,customerNumber) => {
|
||||||
const requestOptions = {
|
const requestOptions = {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -197,7 +202,12 @@ export const doChangeBasicInfo = meWrapRequest((one) => {
|
||||||
"firstname": one.firstname,
|
"firstname": one.firstname,
|
||||||
"lastname": one.lastname,
|
"lastname": one.lastname,
|
||||||
"email": one.email,
|
"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('inProgress', true);
|
||||||
commit('updateAddresses', state.address);
|
commit('updateAddresses', state.address);
|
||||||
commit('formatAddresses');
|
commit('formatAddresses');
|
||||||
const basicInfo = await doUpdateUserAddress(state.one, state.addresses);
|
const basicInfo = await doUpdateUserAddress(state.one, state.addresses,state.customerNumber);
|
||||||
if (basicInfo) {
|
if (basicInfo) {
|
||||||
//commit('successMessage', 'Address Updated Successfully');
|
//commit('successMessage', 'Address Updated Successfully');
|
||||||
commit('inProgress', false);
|
commit('inProgress', false);
|
||||||
|
@ -379,7 +379,7 @@ export const accountOne = {
|
||||||
commit('inProgress', true);
|
commit('inProgress', true);
|
||||||
try {
|
try {
|
||||||
if (passwords == undefined) {
|
if (passwords == undefined) {
|
||||||
const basicInfo = await doChangeBasicInfo(state.one);
|
const basicInfo = await doChangeBasicInfo(state.one,state.customerNumber);
|
||||||
if (basicInfo) {
|
if (basicInfo) {
|
||||||
commit('inProgress', false);
|
commit('inProgress', false);
|
||||||
//commit('successMessage', 'Updated Basic Information Successfully');
|
//commit('successMessage', 'Updated Basic Information Successfully');
|
||||||
|
@ -388,7 +388,7 @@ export const accountOne = {
|
||||||
} else {
|
} else {
|
||||||
const changedPassword = await doChangePassword(passwords.current, passwords.new);
|
const changedPassword = await doChangePassword(passwords.current, passwords.new);
|
||||||
if (changedPassword) {
|
if (changedPassword) {
|
||||||
const basicInfo = await doChangeBasicInfo(state.one);
|
const basicInfo = await doChangeBasicInfo(state.one,state.customerNumber);
|
||||||
commit('inProgress', false);
|
commit('inProgress', false);
|
||||||
//commit('successMessage', 'Updated Basic Information Successfully');
|
//commit('successMessage', 'Updated Basic Information Successfully');
|
||||||
commit('setOne', humps(basicInfo));
|
commit('setOne', humps(basicInfo));
|
||||||
|
@ -492,7 +492,7 @@ export const accountOne = {
|
||||||
try {
|
try {
|
||||||
commit('deleteAddress', address);
|
commit('deleteAddress', address);
|
||||||
commit('formatAddresses');
|
commit('formatAddresses');
|
||||||
const basicInfo = await doUpdateUserAddress(state.one, state.addresses);
|
const basicInfo = await doUpdateUserAddress(state.one, state.addresses,state.customerNumber);
|
||||||
if (basicInfo) {
|
if (basicInfo) {
|
||||||
//commit('successMessage', 'Address Updated Successfully');
|
//commit('successMessage', 'Address Updated Successfully');
|
||||||
commit('fetchInProgress', false);
|
commit('fetchInProgress', false);
|
||||||
|
|
Loading…
Reference in New Issue