fix viewData prop validator, change nullish coalescing operator to logical or since optional router param is empty string and not an unset prop

This commit is contained in:
Harald Bamberger
2025-05-15 18:54:28 +02:00
parent 7b9b1a762e
commit a858049e15
@@ -16,9 +16,9 @@ export const AbgabetoolStudent = {
viewData: {
type: Object,
required: true,
default: () => ({name: '', uid: ''}),
default: () => ({uid: ''}),
validator(value) {
return value && value.name && value.uid
return value && value.uid
}
}
},
@@ -186,7 +186,7 @@ export const AbgabetoolStudent = {
this.$refs.abgabeTable.tabulator.setData(d);
},
loadProjektarbeiten() {
this.$fhcApi.factory.lehre.getStudentProjektarbeiten(this.student_uid_prop ?? this.viewData?.uid ?? null)
this.$fhcApi.factory.lehre.getStudentProjektarbeiten(this.student_uid_prop || this.viewData?.uid || null)
.then(res => {
if(res?.data) this.setupData(res.data)
})