Skip to content

Commit

Permalink
Refactor profile filter
Browse files Browse the repository at this point in the history
  • Loading branch information
harsh-joshi99 committed May 24, 2024
1 parent 4b647b9 commit f9f0b3d
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,16 @@ const action: ActionDefinition<Settings, Payload> = {
performBatch: async (request, { payload }) => {
payload = payload.filter((profile) => profile.email || profile.external_id || profile.phone_number)

const profilesWithList = payload.filter((profile) => profile.list_id || profile.override_list_id)
const profilesWithoutList = payload.filter((profile) => !profile.list_id && !profile.override_list_id)
const profilesWithList: Payload[] = []
const profilesWithoutList: Payload[] = []

payload.forEach((profile) => {
if (profile.list_id || profile.override_list_id) {
profilesWithList.push(profile)
} else {
profilesWithoutList.push(profile)
}
})

let importResponseWithList
let importResponseWithoutList
Expand Down

0 comments on commit f9f0b3d

Please sign in to comment.