Skip to content

Commit

Permalink
Fixing field reference for users
Browse files Browse the repository at this point in the history
  • Loading branch information
julialawrence committed Aug 5, 2024
1 parent 3e174c4 commit 7db4e3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions function/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,9 @@ async function sync (type, payload) {

if (payload.delete.length) {
for (const needsDeleting of payload.delete) {
// Don't delete emails that end with '@justice.gov.uk' [EntraID emails]
if (type === 'users' && needsDeleting.email && needsDeleting.email.endsWith('@justice.gov.uk')) {
console.log(`Skipping deletion of user with email: ${needsDeleting.email}`)
// Don't delete users that end with '@justice.gov.uk' [EntraID emails]
if (type === 'users' && needsDeleting.name && needsDeleting.name.endsWith('@justice.gov.uk')) {
console.log(`Skipping deletion of user with email: ${needsDeleting.name}`)
continue;
}

Expand Down

0 comments on commit 7db4e3d

Please sign in to comment.