Skip to content

Commit

Permalink
fix: only send listing approval email once (#3731)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludtkemorgan authored Nov 22, 2023
1 parent cb32ea1 commit 1d27e25
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions backend/core/src/listings/listings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,10 @@ export class ListingsService {
const nonApprovingRoles = [UserRoleEnum.partner]
if (!params.approvingRoles.includes(UserRoleEnum.jurisdictionAdmin))
nonApprovingRoles.push(UserRoleEnum.jurisdictionAdmin)
if (params.status === ListingStatus.pendingReview) {
if (
params.status === ListingStatus.pendingReview &&
params.previousStatus !== ListingStatus.pendingReview
) {
const userInfo = await this.getUserEmailInfo(
params.approvingRoles,
params.listingInfo.id,
Expand All @@ -330,7 +333,10 @@ export class ListingsService {
)
}
// admin updates status to changes requested when approval requires partner changes
else if (params.status === ListingStatus.changesRequested) {
else if (
params.status === ListingStatus.changesRequested &&
params.previousStatus !== ListingStatus.changesRequested
) {
const userInfo = await this.getUserEmailInfo(
nonApprovingRoles,
params.listingInfo.id,
Expand Down

0 comments on commit 1d27e25

Please sign in to comment.