From 0101a4912ea96222c883014c371c9bfb897c0e6b Mon Sep 17 00:00:00 2001 From: A Vinayak Rugvedi Date: Fri, 26 Jul 2024 13:47:53 +0530 Subject: [PATCH] chore: clear selected partner after saving --- frontend/src/components/projectEdit/partnersForm.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/projectEdit/partnersForm.js b/frontend/src/components/projectEdit/partnersForm.js index 8a4a7d69ec..41255467ea 100644 --- a/frontend/src/components/projectEdit/partnersForm.js +++ b/frontend/src/components/projectEdit/partnersForm.js @@ -139,6 +139,7 @@ export const PartnersForm = () => { startDate: new Date(), endDate: null, }); + setSelectedPartner({}) toast.success(); }, onError: () => { @@ -185,6 +186,7 @@ export const PartnersForm = () => { getOptionLabel={(option) => option.name} getOptionValue={(option) => option.id} options={partners} + value={selectedPartner.id ? selectedPartner : null} placeholder={ isError ? ( @@ -192,7 +194,7 @@ export const PartnersForm = () => { ) } - onChange={(value) => setSelectedPartner(value)} + onChange={(value) => (value ? setSelectedPartner(value) : setSelectedPartner({}))} />