Skip to content

Commit

Permalink
fix: address pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
portikM committed Sep 24, 2024
1 parent 03ed48a commit 49c594c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/KTableData/KTableData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,16 @@ const fetchData = async () => {
return res
}
/**
* Initialize the table with the initial data
*/
const initData = () => {
const fetcherParams = {
...defaultFetcherProps,
...initialFetcherParams,
}
// don't allow overriding default settings with `undefined` values
// don't allow overriding default settings with undefined values
page.value = fetcherParams.page ?? defaultFetcherProps.page
pageSize.value = fetcherParams.pageSize ?? defaultFetcherProps.pageSize
filterQuery.value = fetcherParams.query ?? defaultFetcherProps.query
Expand All @@ -382,7 +386,7 @@ const initData = () => {
const previousOffset = computed((): string | null => offsets.value[page.value - 1])
const nextOffset = ref<string | null>(null)
// once `initData()` finishes, setting tableFetcherCacheKey to non-falsey value triggers fetch of data
// once initData() finishes, setting tableFetcherCacheKey to non-falsey value triggers fetch of data
const tableFetcherCacheKey = computed((): string => {
if (!fetcher || !hasInitialized.value) {
return ''
Expand Down

0 comments on commit 49c594c

Please sign in to comment.