Skip to content

Commit

Permalink
fix: assignedUser can be an empty object
Browse files Browse the repository at this point in the history
  • Loading branch information
superskip committed Nov 13, 2023
1 parent d2b89e9 commit f64a7d7
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/core_modules/capture-core/converters/serverToClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,14 @@ function convertTime(d2Value: string) {
return parseData.momentTime;
}

const convertAssignedUserToClient = (assignedUser?: ApiAssignedUser) => {
if (!assignedUser) {
return null;
}
return {
const convertAssignedUserToClient = (assignedUser?: ApiAssignedUser) =>
((assignedUser && assignedUser.uid) ? {
id: assignedUser.uid,
name: assignedUser.displayName,
username: assignedUser.username,
firstName: assignedUser.firstName,
surname: assignedUser.surname,
};
};
} : null);

const optionSetConvertersForType = {
[dataElementTypes.NUMBER]: parseNumber,
Expand Down

0 comments on commit f64a7d7

Please sign in to comment.