Skip to content

Commit

Permalink
Merge pull request #455 from bcgov/MALS2-16_Auto_Check_Print_License
Browse files Browse the repository at this point in the history
Auto check print licence checkbox
  • Loading branch information
barrfalk authored Mar 19, 2024
2 parents 9dae629 + fa5f9e7 commit 439bbd1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/client/src/features/licences/LicenceDetailsViewEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,12 @@ export default function LicenceDetailsViewEdit({ licence }) {
return { issueDate: today, expiryDate };
};

const [isPrintLicenceChecked, setIsPrintLicenceChecked] = React.useState(initialFormValues.printLicence);

const onRenewCallback = (data) => {
const dates = data;
dispatch(renewLicence({ data: dates, id: licence.data.id }));
setValue("printLicence", true);
setIsPrintLicenceChecked(true);
};

const onRenew = () => {
Expand Down Expand Up @@ -266,7 +268,7 @@ export default function LicenceDetailsViewEdit({ licence }) {
<CustomCheckBox
id="printLicence"
label="Print Licence"
defaultChecked={initialFormValues.printLicence}
defaultChecked={isPrintLicenceChecked}
onChange={(e) =>
onLicenceDetailsCheckboxChange("printLicence", e.target.checked)
}
Expand Down

0 comments on commit 439bbd1

Please sign in to comment.