Skip to content

Commit 6b6e4e4

Browse files
authored
Merge pull request #5446 from 3drepo/ISSUE_5445
ISSUE 5445 - Fix user utility scripts
2 parents a19f9c0 + ae80df6 commit 6b6e4e4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

backend/src/scripts/utility/users/identifyInactiveUsers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ const writeResultsToFile = (results, outFile) => new Promise((resolve) => {
4242

4343
const getFileEntry = async ({ user, roles, customData }) => {
4444
const lastLogin = await getLastLoginDate(user);
45-
const { firstName, lastName, email, billing: { billingInfo: { company } } } = customData;
45+
const { firstName, lastName, email, billing } = customData;
4646
const teamspaceNumber = roles.filter((role) => role.db !== 'admin').length;
4747

48-
return { user, firstName, lastName, email, teamspaceNumber, company: company ?? '', lastLogin: lastLogin ?? '' };
48+
return { user, firstName, lastName, email, teamspaceNumber, company: billing?.billingInfo?.company ?? '', lastLogin: lastLogin ?? '' };
4949
};
5050

5151
const run = async (monthsOfInactivity, outFile) => {

backend/src/scripts/utility/users/identifyOrphanedUsers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ const writeResultsToFile = (results, outFile) => new Promise((resolve) => {
4141

4242
const getFileEntry = async ({ user, customData }) => {
4343
const lastLogin = await getLastLoginDate(user);
44-
const { firstName, lastName, email, billing: { billingInfo: { company } } } = customData;
44+
const { firstName, lastName, email, billing } = customData;
4545

46-
return { user, firstName, lastName, email, company: company ?? '', lastLogin: lastLogin ?? '' };
46+
return { user, firstName, lastName, email, company: billing?.billingInfo?.company ?? '', lastLogin: lastLogin ?? '' };
4747
};
4848

4949
const run = async (outFile) => {

0 commit comments

Comments
 (0)