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

fixed error accepting user access request #3623

Merged
merged 1 commit into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading