Skip to content

Commit

Permalink
fixed error accepting user access request (#3623)
Browse files Browse the repository at this point in the history
Co-authored-by: Stefano Ricci <[email protected]>
  • Loading branch information
SteRiccio and SteRiccio authored Oct 27, 2024
1 parent 1587f74 commit 043277e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion server/modules/user/service/userService.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export const acceptUserAccessRequest = async ({ user, serverUrl, accessRequestAc

// 4) invite user to that group and send email
const surveyId = Survey.getId(survey)
const { userInvited } = await UserInviteService.inviteUsers(
const { invitedUsers } = await UserInviteService.inviteUsers(
{
user,
surveyId,
Expand All @@ -233,9 +233,12 @@ export const acceptUserAccessRequest = async ({ user, serverUrl, accessRequestAc
},
t
)
const userInvited = invitedUsers[0]
const surveyOwnerUuid = User.getUuid(userInvited)

await SurveyManager.updateSurveyOwner({ user, surveyId, ownerUuid: surveyOwnerUuid, system: true }, t)
survey = Survey.assocOwnerUuid(surveyOwnerUuid)(survey)

return { survey, userInvited }
})

Expand Down
2 changes: 1 addition & 1 deletion webapp/components/survey/Surveys/SurveyOwnerColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const SurveyOwnerColumn = (props) => {
canEdit={canEdit}
className="owner-col"
item={surveyInfo}
renderItem={({ item }) => Survey.getOwnerName(item)}
renderItem={({ item }) => Survey.getOwnerName(item) || '---'}
renderItemEditing={() => <SurveyOwnerDropdown selectedUuid={ownerUuid} onChange={onChange} />}
/>
)
Expand Down

0 comments on commit 043277e

Please sign in to comment.