Browse Source

fix(nc-gui): add missing .list

pull/5269/head
Wing-Kam Wong 2 years ago
parent
commit
4204f246eb
  1. 4
      packages/nc-gui/components/account/UserList.vue
  2. 6
      packages/nc-gui/components/smartsheet/header/Menu.vue
  3. 2
      packages/nc-gui/components/smartsheet/toolbar/SharedViewList.vue
  4. 4
      packages/nc-gui/components/tabs/auth/ApiTokenManagement.vue
  5. 4
      packages/nc-gui/composables/useExpandedFormStore.ts
  6. 2
      packages/nc-gui/composables/useViewColumns.ts

4
packages/nc-gui/components/account/UserList.vue

@ -35,13 +35,13 @@ const pagination = reactive({
const loadUsers = async (page = currentPage, limit = currentLimit) => {
currentPage = page
try {
const response: any = await api.orgUsers.list({
const response: any = (await api.orgUsers.list({
query: {
limit,
offset: searchText.value.length === 0 ? (page - 1) * limit : 0,
query: searchText.value,
},
} as RequestParams)
} as RequestParams)).list
if (!response) return
pagination.total = response.pageInfo.totalRows ?? 0

6
packages/nc-gui/components/smartsheet/header/Menu.vue

@ -144,7 +144,7 @@ const duplicateColumn = async () => {
}
try {
const gridViewColumnList = await $api.dbViewColumn.list(view.value?.id as string)
const gridViewColumnList = (await $api.dbViewColumn.list(view.value?.id as string)).list
const currentColumnIndex = gridViewColumnList.findIndex((f) => f.fk_column_id === column!.value.id)
let newColumnOrder
@ -175,7 +175,7 @@ const duplicateColumn = async () => {
// add column before or after current column
const addColumn = async (before = false) => {
const gridViewColumnList = await $api.dbViewColumn.list(view.value?.id as string)
const gridViewColumnList = (await $api.dbViewColumn.list(view.value?.id as string)).list
const currentColumnIndex = gridViewColumnList.findIndex((f) => f.fk_column_id === column!.value.id)
@ -204,7 +204,7 @@ const addColumn = async (before = false) => {
// hide the field in view
const hideField = async () => {
const gridViewColumnList = await $api.dbViewColumn.list(view.value?.id as string)
const gridViewColumnList = (await $api.dbViewColumn.list(view.value?.id as string)).list
const currentColumn = gridViewColumnList.find((f) => f.fk_column_id === column!.value.id)

2
packages/nc-gui/components/smartsheet/toolbar/SharedViewList.vue

@ -34,7 +34,7 @@ const { dashboardUrl } = useDashboard()
const sharedViewList = ref<SharedViewType[]>()
const loadSharedViewsList = async () => {
sharedViewList.value = await $api.dbViewShare.list(meta.value?.id as string)
sharedViewList.value = (await $api.dbViewShare.list(meta.value?.id as string)).list as SharedViewType[]
// todo: show active view in list separately
// const index = sharedViewList.value.findIndex((v) => {

4
packages/nc-gui/components/tabs/auth/ApiTokenManagement.vue

@ -25,7 +25,7 @@ let selectedTokenData = $ref<ApiToken>({})
const loadApiTokens = async () => {
if (!project?.id) return
tokensInfo = await $api.apiToken.list(project.id)
tokensInfo = (await $api.apiToken.list(project.id)).list
}
const openNewTokenModal = () => {
@ -40,7 +40,7 @@ const copyToken = async (token: string | undefined) => {
await copy(token)
// Copied to clipboard
message.info(t('msg.info.copiedToClipboard'))
} catch (e) {
} catch (e: any) {
message.error(e.message)
}
$e('c:api-token:copy')

4
packages/nc-gui/composables/useExpandedFormStore.ts

@ -98,11 +98,11 @@ const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState((m
commentsAndLogs.value =
(
await api.utils.commentList({
(await api.utils.commentList({
row_id: rowId,
fk_model_id: meta.value.id as string,
comments_only: commentsOnly.value,
})
})).list
)?.reverse?.() || []
}

2
packages/nc-gui/composables/useViewColumns.ts

@ -50,7 +50,7 @@ export function useViewColumns(
let order = 1
if (view.value?.id) {
const data = (isPublic.value ? meta.value?.columns : await $api.dbViewColumn.list(view.value.id)) as any[]
const data = (isPublic.value ? meta.value?.columns : (await $api.dbViewColumn.list(view.value.id))).list as any[]
const fieldById = data.reduce<Record<string, any>>((acc, curr) => {
curr.show = !!curr.show

Loading…
Cancel
Save