From 6ed3affe7f6911e85942a6c3c54b937163346bf7 Mon Sep 17 00:00:00 2001 From: Siarhei Iukou Date: Wed, 15 Jan 2025 03:05:45 +0300 Subject: [PATCH 1/3] EPMRPP-97474 || Update request for deleting user avatar --- .../personalInfoBlock/photoControls/photoControls.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/pages/inside/profilePage/personalInfoBlock/photoControls/photoControls.jsx b/app/src/pages/inside/profilePage/personalInfoBlock/photoControls/photoControls.jsx index 49df8aec53..8b783b760b 100644 --- a/app/src/pages/inside/profilePage/personalInfoBlock/photoControls/photoControls.jsx +++ b/app/src/pages/inside/profilePage/personalInfoBlock/photoControls/photoControls.jsx @@ -166,7 +166,7 @@ export class PhotoControls extends Component { } }; removeImageHandler = () => { - fetch(URLS.dataPhoto(), { method: 'delete' }) + fetch(URLS.userAvatar(), { method: 'delete' }) .then(() => { this.props.removeImage(); this.props.setPhotoTimeStampAction(Date.now()); From c655b68da2363f609089ce17b0054bcab10b7219 Mon Sep 17 00:00:00 2001 From: Siarhei Iukou Date: Wed, 15 Jan 2025 14:34:44 +0300 Subject: [PATCH 2/3] EPMRPP-97474 || Code Review fix - 1 --- .../inside/profilePage/personalInfoBlock/personalInfoBlock.jsx | 1 + .../personalInfoBlock/photoControls/photoControls.jsx | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/pages/inside/profilePage/personalInfoBlock/personalInfoBlock.jsx b/app/src/pages/inside/profilePage/personalInfoBlock/personalInfoBlock.jsx index 0c8ce2df18..76fb5c07d6 100644 --- a/app/src/pages/inside/profilePage/personalInfoBlock/personalInfoBlock.jsx +++ b/app/src/pages/inside/profilePage/personalInfoBlock/personalInfoBlock.jsx @@ -212,6 +212,7 @@ export class PersonalInfoBlock extends Component { accountType={accountType} uploadNewImage={this.uploadNewImage} removeImage={this.removeImage} + userId={userId} /> )} {accountType === INTERNAL && ( diff --git a/app/src/pages/inside/profilePage/personalInfoBlock/photoControls/photoControls.jsx b/app/src/pages/inside/profilePage/personalInfoBlock/photoControls/photoControls.jsx index 8b783b760b..419d9ddd80 100644 --- a/app/src/pages/inside/profilePage/personalInfoBlock/photoControls/photoControls.jsx +++ b/app/src/pages/inside/profilePage/personalInfoBlock/photoControls/photoControls.jsx @@ -85,6 +85,7 @@ export class PhotoControls extends Component { showModalAction: PropTypes.func.isRequired, showNotification: PropTypes.func.isRequired, setPhotoTimeStampAction: PropTypes.func.isRequired, + userId: PropTypes.string.isRequired, tracking: PropTypes.shape({ trackEvent: PropTypes.func, getTrackingData: PropTypes.func, @@ -114,7 +115,7 @@ export class PhotoControls extends Component { onSave = () => { const formData = new FormData(); formData.append('file', this.state.image); - fetch(URLS.dataPhoto(), { method: 'post', data: formData }) + fetch(URLS.dataPhoto(this.props.userId), { method: 'post', data: formData }) .then(() => { this.props.showNotification({ message: this.props.intl.formatMessage(messages.submitUpload), From b71029c1d00126e15a35ddcf816947a86f584e16 Mon Sep 17 00:00:00 2001 From: Siarhei Iukou Date: Wed, 15 Jan 2025 14:39:33 +0300 Subject: [PATCH 3/3] EPMRPP-97474 || Code Review fix - 1 --- .../personalInfoBlock/photoControls/photoControls.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/pages/inside/profilePage/personalInfoBlock/photoControls/photoControls.jsx b/app/src/pages/inside/profilePage/personalInfoBlock/photoControls/photoControls.jsx index 419d9ddd80..4a2f6057ca 100644 --- a/app/src/pages/inside/profilePage/personalInfoBlock/photoControls/photoControls.jsx +++ b/app/src/pages/inside/profilePage/personalInfoBlock/photoControls/photoControls.jsx @@ -115,7 +115,7 @@ export class PhotoControls extends Component { onSave = () => { const formData = new FormData(); formData.append('file', this.state.image); - fetch(URLS.dataPhoto(this.props.userId), { method: 'post', data: formData }) + fetch(URLS.dataPhoto(), { method: 'post', data: formData }) .then(() => { this.props.showNotification({ message: this.props.intl.formatMessage(messages.submitUpload), @@ -167,7 +167,7 @@ export class PhotoControls extends Component { } }; removeImageHandler = () => { - fetch(URLS.userAvatar(), { method: 'delete' }) + fetch(URLS.userAvatar(this.props.userId), { method: 'delete' }) .then(() => { this.props.removeImage(); this.props.setPhotoTimeStampAction(Date.now());