Fix sorting for tables

This commit is contained in:
Andrew Kingston 2023-08-03 11:27:33 +01:00
parent e3cf0667be
commit 3e97e299bf
3 changed files with 4 additions and 2 deletions

View File

@ -86,7 +86,7 @@ export const createActions = context => {
if ($datasource.type === "table") {
await API.saveTable(newDefinition)
} else if ($datasource.type === "viewV2") {
await API.viewV2.update({ ...newDefinition })
await API.viewV2.update(newDefinition)
}
}

View File

@ -17,7 +17,7 @@ import * as Filter from "./filter"
import * as Notifications from "./notifications"
import * as Table from "./table"
import * as ViewV2 from "./viewV2"
import * as Datasource from "./datsource"
import * as Datasource from "./datasource"
const DependencyOrderedStores = [
// Common stores

View File

@ -15,6 +15,8 @@ export const initialise = context => {
// Update fetch when sorting changes
sort.subscribe($sort => {
if (get(datasource)?.type === "table") {
console.log("update", $sort)
console.log(get(fetch))
get(fetch)?.update({
sortOrder: $sort.order,
sortColumn: $sort.column,