Merge pull request #848 from sharetribe/fix-missing-profileImage-variants

Fix missing profile image variants
This commit is contained in:
Vesa Luusua 2018-05-29 13:31:11 +03:00 committed by GitHub
commit 4a0db248cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 2 deletions

View file

@ -18,6 +18,9 @@ way to update this template, but currently, we follow a pattern:
[#846](https://github.com/sharetribe/flex-template-web/pull/846)
* [fix] Add missing styles for ModalMissingInformation from Topbar
[#847](https://github.com/sharetribe/flex-template-web/pull/847)
* [fix] API does not return all image variants anymore, this adds correct variants to update
contact details call.
[#848](https://github.com/sharetribe/flex-template-web/pull/848)
## v0.3.1

View file

@ -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) {