Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update delete-discount.ts

Kiran K0a93a55f38ca
diff --git a/apps/web/lib/api/partners/delete-discount.ts b/apps/web/lib/api/partners/delete-discount.ts
index b1dfc22ce5..d99c620f25 100644
--- a/apps/web/lib/api/partners/delete-discount.ts
+++ b/apps/web/lib/api/partners/delete-discount.ts
@@ -99,22 +99,21 @@ export async function deleteDiscount({
},
}),
- user
- ? recordAuditLog({
- workspaceId: workspace.id,
- programId,
- action: "discount.deleted",
- description: `Discount ${discount.id} deleted`,
- actor: user,
- targets: [
- {
- type: "discount",
- id: discount.id,
- metadata: discount,
- },
- ],
- })
- : Promise.resolve(),
+ user &&
+ recordAuditLog({
+ workspaceId: workspace.id,
+ programId,
+ action: "discount.deleted",
+ description: `Discount ${discount.id} deleted`,
+ actor: user,
+ targets: [
+ {
+ type: "discount",
+ id: discount.id,
+ metadata: discount,
+ },
+ ],
+ }),
discount.couponId &&
deleteStripeCoupon({