Skip to content

Commit

Permalink
N21-1269 review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
arnegns committed Sep 22, 2023
1 parent 1617f76 commit 6227045
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions controllers/oauth2.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,10 @@ router.get('/username/:pseudonym', async (req, res, next) => {
qs: { id: pseudonymResponse.userId },
$limit: 1,
});
completeName = `${userResponse.data[0].firstName} ${userResponse.data[0].lastName}`;
shortName = `${userResponse.data[0].firstName} ${userResponse.data[0].lastName.charAt(0)}.`;
if (userResponse.data?.length === 1) {
completeName = `${userResponse.data[0].firstName} ${userResponse.data[0].lastName}`;
shortName = `${userResponse.data[0].firstName} ${userResponse.data[0].lastName.charAt(0)}.`;
}
} else {
const feathersPseudonymResponse = await api(req)
.get('/pseudonym', {
Expand Down

0 comments on commit 6227045

Please sign in to comment.