Skip to content

Commit

Permalink
chore: clear selected partner after saving
Browse files Browse the repository at this point in the history
  • Loading branch information
VinayakRugvedi authored and bshankar committed Jul 26, 2024
1 parent 42a7805 commit 0101a49
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/components/projectEdit/partnersForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export const PartnersForm = () => {
startDate: new Date(),
endDate: null,
});
setSelectedPartner({})
toast.success(<FormattedMessage {...messages.partnerLinkActionSuccessToast} />);
},
onError: () => {
Expand Down Expand Up @@ -185,14 +186,15 @@ export const PartnersForm = () => {
getOptionLabel={(option) => option.name}
getOptionValue={(option) => option.id}
options={partners}
value={selectedPartner.id ? selectedPartner : null}
placeholder={
isError ? (
<FormattedMessage {...messages.partnerActionsApiError} />
) : (
<FormattedMessage {...messages.selectPartner} />
)
}
onChange={(value) => setSelectedPartner(value)}
onChange={(value) => (value ? setSelectedPartner(value) : setSelectedPartner({}))}
/>

<div className="mt2 flex items-start" style={{ gap: '0.75rem' }}>
Expand Down

0 comments on commit 0101a49

Please sign in to comment.