Skip to content

Commit

Permalink
Made change as suggested
Browse files Browse the repository at this point in the history
  • Loading branch information
ejscheepers committed Oct 15, 2024
1 parent a0e119e commit 52f4a3c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/api/src/controllers/v1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,12 @@ export class V1 {
redis.del(Keys.Contact.id(contact.id));
redis.del(Keys.Contact.email(project.id, contact.email));
} else {
if (subscribed !== undefined && contact.subscribed !== subscribed) {
contact = await prisma.contact.update({
where: { id: contact.id },
data: { subscribed: subscribed ?? true },
});

if (subscribed !== null && contact.subscribed !== subscribed) {
contact = await prisma.contact.update({where: {id: contact.id}, data: {subscribed}});

redis.del(Keys.Contact.id(contact.id));
redis.del(Keys.Contact.email(project.id, contact.email));
}
}
}

if (data) {
Expand Down

0 comments on commit 52f4a3c

Please sign in to comment.