fix: compatability layer for query builder joins

This commit is contained in:
Julian Krauser 2025-05-02 09:16:29 +02:00
parent fa8f051252
commit 9cf2cf2d80

View file

@ -12,7 +12,7 @@
<ArrowsUpDownIcon class="text-gray-500 h-6 w-6 cursor-pointer" /> <ArrowsUpDownIcon class="text-gray-500 h-6 w-6 cursor-pointer" />
</div> </div>
<select v-if="value.type == 'defined'" v-model="context" class="w-full"> <select v-if="type == 'defined'" v-model="context" class="w-full">
<option value="" disabled>Relation auswählen</option> <option value="" disabled>Relation auswählen</option>
<option <option
v-for="relation in activeTable?.relations" v-for="relation in activeTable?.relations"
@ -121,6 +121,17 @@ export default defineComponent({
} }
}, },
}, },
type: {
get(): string {
return this.modelValue.type ?? "defined";
},
set(val: "custom" | "defined") {
this.$emit("update:model-value", {
...this.modelValue,
type: val,
});
},
},
joinTable: { joinTable: {
get(): string { get(): string {
return this.modelValue.table; return this.modelValue.table;
@ -137,13 +148,17 @@ export default defineComponent({
if (!this.value.id) { if (!this.value.id) {
this.value.id = uuid(); this.value.id = uuid();
} }
if (!this.value.type) {
console.log("setting type");
this.type = "defined";
}
}, },
methods: { methods: {
swapJoinType(type: string) { swapJoinType(type: string) {
if (type == "defined") { if (type == "defined") {
this.value.type = "custom"; this.type = "custom";
} else { } else {
this.value.type = "defined"; this.type = "defined";
} }
}, },
}, },