Skip to content

Commit

Permalink
Contact is not in target group if no filters or no contact attributes…
Browse files Browse the repository at this point in the history
… are present (#88)

Co-authored-by: Denise Buder <[email protected]>
  • Loading branch information
RainbowBunchie and RainbowBunchie authored Sep 11, 2024
1 parent 8ab1188 commit 494fe87
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/api/src/target-group/target-groups.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ export class TargetGroupsService {
contactAttributes?: BrevoContactAttributesInterface,
filters?: BrevoContactFilterAttributesInterface,
): boolean {
if (!contactAttributes) return false;

if (filters) {
if (filters && contactAttributes) {
for (const [key, value] of Object.entries(filters)) {
if (!value) continue;
if (value.includes(contactAttributes[key])) {
Expand All @@ -49,7 +47,7 @@ export class TargetGroupsService {
return true;
}

return true;
return false;
}

public async assignContactsToContactList(
Expand Down

0 comments on commit 494fe87

Please sign in to comment.