Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENG-5114 integration API /userProfiles/avatar to upload the avatar #1582

Closed
wants to merge 4 commits into from

Conversation

ryanjpburgos
Copy link
Contributor

No description provided.

Copy link
Member

@ichalagashvili ichalagashvili left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG, but couple of small things

Comment on lines 5 to 13
export const getBase64 = file => (
new Promise((resolve) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => {
const base64 = reader.result.split(',');
resolve(base64[1]);
};
}));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function already exists on line 36 in src\state\file-browser\actions.js

Comment on lines 24 to 25
const requestObject = await createFileObject(avatar);
dispatch(toggleLoading(loader));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think toggle loading should be above the await line

method: METHODS.DELETE,
mockResponse: FILE_BROWSER_FILE,
useAuthentication: true,
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a new line at the end of the file

expect(dispatch).toHaveBeenCalledWith({ type: 'errors/add-errors', payload: { errors: TypeError('[TypeError: Failed to execute \'readAsDataURL\' on \'FileReader\': parameter 1 is not of type \'Blob\'.]') } });
expect(dispatch).toHaveBeenCalledTimes(3);
});
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a new line at the end of the file

dispatch(addErrors(error));
dispatch(addToast(message, TOAST_ERROR));
}
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a new line at the end of the file

ichalagashvili
ichalagashvili previously approved these changes Dec 19, 2023
Copy link

Requested publication of version 7.3.0-ENG-5114-PR-1582

ichalagashvili
ichalagashvili previously approved these changes Dec 20, 2023
Copy link

Requested publication of version 7.3.0-ENG-5114-PR-1582

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants