Skip to content

Commit

Permalink
SonarCloud suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
feedmypixel committed Dec 17, 2024
1 parent 4d5b9ef commit 9aacd6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/server/admin/teams/controllers/add/add-member.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ const addMemberController = {

request.yar.flash(
sessionNames.globalValidationFailures,
rejectedResponse.map(
(rejectedResponse) => rejectedResponse.reason.message
)
rejectedResponse.map((response) => response.reason.message)
)

return h.redirect('/admin/teams/' + teamId + '/add-member' + queryString)
Expand Down
8 changes: 3 additions & 5 deletions src/server/teams/controllers/add/add-member.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ const addMemberController = {
}

if (!validationResult.error) {
const addUserToTeamPromises = userIds.map(
async (userId) => await addMemberToTeam(request, teamId, userId)
const addUserToTeamPromises = userIds.map((userId) =>
addMemberToTeam(request, teamId, userId)
)

const responses = await Promise.allSettled(addUserToTeamPromises)
Expand Down Expand Up @@ -88,9 +88,7 @@ const addMemberController = {

request.yar.flash(
sessionNames.globalValidationFailures,
rejectedResponse.map(
(rejectedResponse) => rejectedResponse.reason.message
)
rejectedResponse.map((response) => response.reason.message)
)

return h.redirect('/teams/' + teamId + '/add-member' + queryString)
Expand Down

0 comments on commit 9aacd6e

Please sign in to comment.