diff --git a/frontend/components/global/ComboBox.vue b/frontend/components/global/ComboBox.vue index 19622a0..6c06e4a 100644 --- a/frontend/components/global/ComboBox.vue +++ b/frontend/components/global/ComboBox.vue @@ -33,7 +33,7 @@ const emit = defineEmits(["update:modelValue"]); // state -const value = ref(); +const value = ref(); // watch @@ -49,7 +49,10 @@ watch( watch( () => modelValue.value, (newValue) => { - const target = options.value.flatMap((option) => option.children).find((child) => child.id == newValue); + let target; + target = newValue?.toString().startsWith("category") + ? options.value.find((child) => child.slug == newValue) + : options.value.flatMap((option) => option.children).find((child) => child.slug == newValue); value.value = target || undefined; },