Skip to content

Commit

Permalink
fix wrong type in api due to new target group input
Browse files Browse the repository at this point in the history
  • Loading branch information
RainbowBunchie committed Jan 29, 2024
1 parent 9105551 commit 31b7542
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/api/src/brevo-api/brevo-api-contact.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ export class BrevoApiContactsService {
return data.body.id;
}

public async updateBrevoContactList(id: number, input: TargetGroupInputInterface): Promise<boolean> {
const data = await this.contactsApi.updateList(id, { name: input.title });
public async updateBrevoContactList(id: number, title: string): Promise<boolean> {
const data = await this.contactsApi.updateList(id, { name: title });
return data.response.statusCode === 204;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/target-group/target-group.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export function createTargetGroupsResolver({
await this.targetGroupsService.assignContactsToContactList(input.filters, targetGroup.brevoId, targetGroup.scope);

if (input.title && input.title !== targetGroup.title) {
const successfullyUpdatedContactList = await this.brevoApiContactsService.updateBrevoContactList(targetGroup.brevoId, input);
const successfullyUpdatedContactList = await this.brevoApiContactsService.updateBrevoContactList(targetGroup.brevoId, input.title);
if (!successfullyUpdatedContactList) {
throw Error("Brevo Error: Could not update contact list");
}
Expand Down

0 comments on commit 31b7542

Please sign in to comment.