Skip to content

Commit

Permalink
fix: sort by doesn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
nextchamp-saqib committed Dec 11, 2024
1 parent 83d146d commit 6f9d1ad
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/src2/charts/components/ChartBuilderTableColumn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
Check,
XIcon,
} from 'lucide-vue-next'
import { computed, h } from 'vue'
import { computed, h, watchEffect } from 'vue'
import ContentEditable from '../../components/ContentEditable.vue'
import { FIELDTYPES, granularityOptions } from '../../helpers/constants'
import { column } from '../../query/helpers'
Expand All @@ -21,6 +21,12 @@ const props = defineProps<{
onGranularityChange?: (column_name: string, granularity: GranularityType) => void
}>()
watchEffect(() => {
if (!props.config.order_by) {
props.config.order_by = []
}
})
const currentSortOrder = computed(() => {
return props.config.order_by?.find((order) => order.column.column_name === props.column.name)
})
Expand Down

0 comments on commit 6f9d1ad

Please sign in to comment.