Skip to content

Commit

Permalink
Reset Exemption Validations for Staff (#1592)
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron-eyds authored Oct 23, 2023
1 parent c7db1fd commit e302f5a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ppr-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ppr-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ppr-ui",
"version": "2.1.18",
"version": "2.1.19",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
Expand Down
11 changes: 10 additions & 1 deletion ppr-ui/src/composables/exemption/useExemptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ import { APIMhrDescriptionTypes, MhApiStatusTypes, RouteNames, UnitNoteDocTypes
export const useExemptions = () => {
const { goToRoute } = useNavigation()
const { setMhrExemption, setMhrExemptionNote, setMhrExemptionValidation, setMhrExemptionValue } = useStore()
const { getMhrExemption, isRoleStaffReg, isRoleQualifiedSupplier } = storeToRefs(useStore())
const {
getMhrExemption,
getMhrExemptionValidation,
isRoleStaffReg,
isRoleQualifiedSupplier
} = storeToRefs(useStore())

/** Returns true when staff or qualified supplier and the feature flag is enabled **/
const isExemptionEnabled: ComputedRef<boolean> = computed((): boolean => {
Expand Down Expand Up @@ -92,6 +97,10 @@ export const useExemptions = () => {
updateValidation('documentId', true)
updateValidation('submittingParty', true)
updateValidation('staffPayment', true)
} else {
const validationState = getMhrExemptionValidation.value
// eslint-disable-next-line no-return-assign
Object.keys(validationState).forEach(flag => validationState[flag] = false)
}
}

Expand Down

0 comments on commit e302f5a

Please sign in to comment.