diff --git a/server/modules/user/service/userService.js b/server/modules/user/service/userService.js index bc80d07d5d..11ec667dd1 100644 --- a/server/modules/user/service/userService.js +++ b/server/modules/user/service/userService.js @@ -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, @@ -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 } }) diff --git a/webapp/components/survey/Surveys/SurveyOwnerColumn.js b/webapp/components/survey/Surveys/SurveyOwnerColumn.js index 9e9a851c30..997ec0cbae 100644 --- a/webapp/components/survey/Surveys/SurveyOwnerColumn.js +++ b/webapp/components/survey/Surveys/SurveyOwnerColumn.js @@ -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={() => } /> )