From 31115b7c6adc3c482d8fdb1f933ac7b68d1a3cc5 Mon Sep 17 00:00:00 2001 From: Bilal Catic Date: Wed, 19 Sep 2018 16:07:41 +0200 Subject: [PATCH] add helper to transform snake case to camel case --- frontend/src/helpers/CountryHelper.js | 6 ++++++ frontend/src/helpers/ProfileHelper.js | 15 +++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 frontend/src/helpers/CountryHelper.js create mode 100644 frontend/src/helpers/ProfileHelper.js diff --git a/frontend/src/helpers/CountryHelper.js b/frontend/src/helpers/CountryHelper.js new file mode 100644 index 0000000..e1c2ca6 --- /dev/null +++ b/frontend/src/helpers/CountryHelper.js @@ -0,0 +1,6 @@ +export const fromWiaasCountryList = (countryList) => { + return { + idCountry: countryList.country_id, + countryName: countryList.country_name + } +} \ No newline at end of file diff --git a/frontend/src/helpers/ProfileHelper.js b/frontend/src/helpers/ProfileHelper.js new file mode 100644 index 0000000..b03bf2b --- /dev/null +++ b/frontend/src/helpers/ProfileHelper.js @@ -0,0 +1,15 @@ +export const fromWiaasProfileInfo = (profileInfo) => { + return { + id: profileInfo.id, + idCompany: profileInfo.company_id, + companyName: profileInfo.company_name, + vatCode: profileInfo.vat_code, + isCompanyAdmin: profileInfo.is_company_admin, + mail: profileInfo.mail, + name: profileInfo.name, + phone: profileInfo.phone, + billingAddresses: profileInfo.billing_addresses, + profileAddresses: profileInfo.profile_addresses, + userType: profileInfo.user_type, + } +}; \ No newline at end of file