Skip to content

Commit 125e47a

Browse files
committed
Get view columns directly from typeProperties to avoid circular dependency
1 parent 2b4398f commit 125e47a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/components/AutoQueryGrid.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,14 @@ const viewModelColumns = computed(() => {
268268
: viewProps
269269
})
270270
const filteredColumns = computed(() => {
271-
let viewColumns = viewModelColumns.value.map(x => x.name)
271+
// Get view columns directly from typeProperties to avoid circular dependency
272+
const viewProps = typeProperties(viewModel.value)
273+
let selectedCols = getSelectedColumns()
274+
let selectedLower = selectedCols.map(x => x.toLowerCase())
275+
let viewColumns = selectedLower.length > 0
276+
? selectedLower.map(x => viewProps.find(p => p.name.toLowerCase() === x)).filter(x => x != null).map(x => x!.name)
277+
: viewProps.map(x => x.name)
278+
272279
let filterColumns = asStrings(apiPrefs.value.selectedColumns).map(x => x.toLowerCase())
273280
return filterColumns.length > 0
274281
? viewColumns.filter(x => filterColumns.includes(x.toLowerCase()))
@@ -456,10 +463,9 @@ async function search(args:any) {
456463
return
457464
}
458465
let requestDto = createDto(op, args)
459-
466+
460467
let r = await client.api(requestDto)
461468
let complete = delaySet(x => {
462-
api.value.response = api.value.error = undefined
463469
apiLoading.value = x
464470
if (!isIOS) {
465471
api.value = r

0 commit comments

Comments
 (0)