Skip to content

Commit

Permalink
Merge pull request #848 from sharetribe/fix-missing-profileImage-vari…
Browse files Browse the repository at this point in the history
…ants

Fix missing profile image variants
  • Loading branch information
Gnito authored May 29, 2018
2 parents f4840ce + 734a3da commit 4a0db24
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
18 changes: 16 additions & 2 deletions src/containers/ContactDetailsPage/ContactDetailsPage.duck.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 4a0db24

Please sign in to comment.