fix(rating): compliance condition placement

This commit is contained in:
Daniel Klein 2024-09-25 20:36:39 +02:00
parent ad5a944f1b
commit 1d06159cbd

View file

@ -254,9 +254,6 @@ export const useData = defineStore('data', () => {
value = field value = field
if (value !== undefined) if (value !== undefined)
isValid = value === ref.condition.equals isValid = value === ref.condition.equals
if (ref.field === 'compliance') {
negative = value
}
} }
if (ref.condition.exists !== undefined) { if (ref.condition.exists !== undefined) {
@ -264,6 +261,10 @@ export const useData = defineStore('data', () => {
if (value !== undefined) if (value !== undefined)
isValid = !!value isValid = !!value
} }
if (ref.field === 'compliance') {
negative = value
}
rankPoints += isValid ? ref.points : 0 rankPoints += isValid ? ref.points : 0
maxPoints += ref.points maxPoints += ref.points
return { return {