Skip to content

Commit

Permalink
feat: add deleteMany variables functionality
Browse files Browse the repository at this point in the history
Add the ability to delete multiple variables by ID except for specified ones in EmailTemplate model.
  • Loading branch information
schettn committed Mar 11, 2024
1 parent da7cac8 commit 9439022
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/repository/models/EmailTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ export class EmailTemplate extends EmailTemplateRepository {
description: data.description,
parentId: data.parentId,
variables: {
deleteMany: {
emailTemplateId: id,
NOT: data.variables.map((v) => ({ name: v.name })),
},
upsert: data.variables.map((variable) => ({
create: {
name: variable.name,
Expand Down

0 comments on commit 9439022

Please sign in to comment.