Browse Source

refactor(gui-v2): sort view list on `loadViews`

pull/2837/head
braks 2 years ago
parent
commit
5f08832f68
  1. 5
      packages/nc-gui-v2/composables/useViews.ts

5
packages/nc-gui-v2/composables/useViews.ts

@ -10,7 +10,10 @@ export default function (meta: MaybeRef<TableType | undefined>) {
const _meta = unref(meta)
if (_meta && _meta.id) {
views = (await $api.dbView.list(_meta.id)).list as (GridType | FormType | KanbanType | GalleryType)[]
const response = (await $api.dbView.list(_meta.id)).list as any[]
if (response) {
views = response.sort((a, b) => a.order - b.order)
}
}
}

Loading…
Cancel
Save