fix: saving an account setting will no longer delete a time zone pref… (#29)

* fix: saving an account setting will no longer delete a time zone preference

* Update service.js
This commit is contained in:
Adam Butterworth
2019-05-13 09:44:53 -06:00
committed by GitHub
parent c8d84fc5ab
commit 2e83d33de2

View File

@@ -41,6 +41,9 @@ function unpackFieldErrors(fieldErrors) {
function unpackAccountResponseData(data) {
const unpackedData = data;
// This is handled by preferences
delete unpackedData.time_zone;
SOCIAL_PLATFORMS.forEach(({ id, key }) => {
const platformData = data.social_links.find(({ platform }) => platform === id);
unpackedData[key] = typeof platformData === 'object' ? platformData.social_link : '';