Skip to content

Commit 6f59d21

Browse files
Merge pull request #3353 from OneCommunityGlobal/Koushica_QST_Link_Auto_Save_Hoyfix
Koushica - Hotfix - userProfile QST auto save
2 parents 1fd8a68 + 9037905 commit 6f59d21

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/components/UserProfile/QuickSetupModal/AssignSetupModal.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function AssignSetUpModal({ isOpen, setIsOpen, title, userProfile, setUserProfil
8080
if (hasPermission("manageAdminLinks")) {
8181
setUserProfile(prev => ({ ...prev, ...data }));
8282
}
83-
const result = await handleSubmit();
83+
const result = await handleSubmit(Object.assign({},userProfile,data));
8484

8585
setTitleOnSet(true);
8686
setValid(() => ({ volunteerAgree: false }));

src/components/UserProfile/UserProfile.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,14 +638,15 @@ function UserProfile(props) {
638638
}
639639
};
640640

641-
const handleSubmit = async () => {
641+
const handleSubmit = async (updatedUserProfile) => {
642642
for (let i = 0; i < updatedTasks.length; i += 1) {
643643
const updatedTask = updatedTasks[i];
644644
const url = ENDPOINTS.TASK_UPDATE(updatedTask.taskId);
645645
axios.put(url, updatedTask.updatedTask).catch(err => console.log(err));
646646
}
647647
try {
648-
const result = await props.updateUserProfile(userProfileRef.current);
648+
const userProfileToUpdate = updatedUserProfile || userProfileRef.current;
649+
const result = await props.updateUserProfile(userProfileToUpdate);
649650
if (userProfile._id === props.auth.user.userid && props.auth.user.role !== userProfile.role) {
650651
await props.refreshToken(userProfile._id);
651652
}

0 commit comments

Comments
 (0)