update and read customer phone number, company name and VAT number

This commit is contained in:
GotPPay
2018-08-29 08:20:19 +02:00
committed by Bilal Catic
parent bc61e2e706
commit 4ce7b86ea9
2 changed files with 36 additions and 8 deletions

View File

@@ -68,6 +68,7 @@ export const saveProfileInfo = (idUser, profile) => {
data: {
'first_name': parsedFullName[0],
'last_name': parsedFullName[1],
'phone': profile.phone
}
})
.then(response => {
@@ -90,9 +91,12 @@ export const saveCompanyInfo = (idUser, companyInfo) => {
return dispatch => {
dispatch(requestSaveCompany());
return client.fetch({
url: `${API_SERVER}/profileSettings/api/saveCompanyInfo`,
method: 'post',
data: {companyInfo: JSON.stringify(companyInfo)}
url: `${API_SERVER}/wp-json/wc/v2/customers/${idUser}`,
method: 'put',
data: {
vatCode: companyInfo.vatCode,
companyName: companyInfo.companyName
}
})
.then(response => {
if(response.data && response.data.messages){