From 17cad7790fb41d2c01e730255ff7bf645cd0efaf Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Mon, 28 May 2018 13:47:43 +0300 Subject: [PATCH] Image variants to included profileImage. (API has changed: returns defaults instead of all) --- .../ContactDetailsPage.duck.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/containers/ContactDetailsPage/ContactDetailsPage.duck.js b/src/containers/ContactDetailsPage/ContactDetailsPage.duck.js index 16eca7f8..94d661bc 100644 --- a/src/containers/ContactDetailsPage/ContactDetailsPage.duck.js +++ b/src/containers/ContactDetailsPage/ContactDetailsPage.duck.js @@ -79,7 +79,14 @@ const requestSavePhoneNumber = params => (dispatch, getState, sdk) => { const phoneNumber = params.phoneNumber; return sdk.currentUser - .updateProfile({ protectedData: { phoneNumber } }, { expand: true, include: ['profileImage'] }) + .updateProfile( + { protectedData: { phoneNumber } }, + { + expand: true, + include: ['profileImage'], + 'fields.image': ['variants.square-small', 'variants.square-small2x'], + } + ) .then(response => { const entities = denormalisedResponseEntities(response); if (entities.length !== 1) { @@ -104,7 +111,14 @@ const requestSaveEmail = params => (dispatch, getState, sdk) => { const { email, currentPassword } = params; return sdk.currentUser - .changeEmail({ email, currentPassword }, { expand: true, include: ['profileImage'] }) + .changeEmail( + { email, currentPassword }, + { + expand: true, + include: ['profileImage'], + 'fields.image': ['variants.square-small', 'variants.square-small2x'], + } + ) .then(response => { const entities = denormalisedResponseEntities(response); if (entities.length !== 1) {