From 0f24fd6edc8d67b210340a267c9a406e0a3f5a8d Mon Sep 17 00:00:00 2001 From: Joedeep Singh Date: Mon, 13 Oct 2025 14:54:03 +0000 Subject: [PATCH] feat(coupon-details): prevent duplicate course/batch selections and clear name on type change --- .../src/components/Settings/CouponDetails.vue | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/frontend/src/components/Settings/CouponDetails.vue b/frontend/src/components/Settings/CouponDetails.vue index 8a552af4..671d2f0c 100644 --- a/frontend/src/components/Settings/CouponDetails.vue +++ b/frontend/src/components/Settings/CouponDetails.vue @@ -65,10 +65,12 @@ { label: 'Course ', value: 'LMS Course' }, { label: 'Batch ', value: 'LMS Batch' }, ]" + @change="(val) => (row.reference_name = null)" /> i !== idx && r.reference_doctype === doctype && r.reference_name + ) + .map((r) => r.reference_name) + if (selectedNames.length === 0) return {} + return { + name: ['not in', selectedNames], + } +} + const saveDoc = createResource({ url: 'frappe.client.save', makeParams(values) {