change whole backend and tables for gorm table references

simplify tables with table components close #31
This commit is contained in:
Adrian Zürcher
2025-11-29 15:59:18 +01:00
parent 62549c9039
commit bdcceb53e0
29 changed files with 646 additions and 514 deletions

View File

@@ -44,7 +44,7 @@ const props = defineProps({
required: true,
},
optionLabel: {
type: [Function, String] as PropType<((option: T) => string) | string>,
type: [Function, String] as PropType<((option: T) => string) | string | undefined>,
required: true,
},
optionValue: {
@@ -61,7 +61,7 @@ const optionLabel = props.optionLabel;
const optionValue = props.optionValue;
const modelValueLocal = ref<string | number | object | null | undefined>(props.modelValue);
const filteredOptions = ref<T[]>([...props.options]);
const filteredOptions = ref<T[]>([...(props.options || [])]);
function searchBox() {
if (search.value) {
@@ -91,7 +91,7 @@ function filterFn(val: string, update: (fn: () => void) => void) {
if (typeof optionLabel === 'function') {
field = optionLabel(opt);
} else {
field = opt[optionLabel];
field = opt[String(optionLabel)];
}
if (typeof field !== 'string' && typeof field !== 'number') return false;