Browse Source

chore(swagger): typo correction

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3065/head
Pranav C 2 years ago
parent
commit
3fa129ea82
  1. 5
      packages/nc-gui-v2/components/smartsheet-toolbar/ShareView.vue
  2. 3
      packages/nc-gui-v2/composables/useColumnCreateStore.ts
  3. 3
      packages/nc-gui-v2/composables/useExpandedFormStore.ts
  4. 2
      packages/nc-gui-v2/composables/useGridViewColumnWidth.ts
  5. 6
      packages/nc-gui-v2/composables/useLTARStore.ts
  6. 8
      packages/nc-gui-v2/composables/useViewColumns.ts
  7. 6
      packages/nc-gui-v2/composables/useViewFilters.ts
  8. 3
      packages/nc-gui-v2/composables/useViewSorts.ts
  9. 23
      packages/nocodb-sdk/src/lib/Api.ts
  10. 94
      scripts/sdk/swagger.json

5
packages/nc-gui-v2/components/smartsheet-toolbar/ShareView.vue

@ -65,12 +65,11 @@ async function saveAllowCSVDownload() {
try {
const meta = shared.value.meta && typeof shared.value.meta === 'string' ? JSON.parse(shared.value.meta) : shared.value.meta
// todo: update swagger
await $api.dbViewShare.update(shared.value.id, {
meta,
} as any)
})
toast.success('Successfully updated')
} catch (e) {
} catch (e: any) {
toast.error(await extractSdkResponseErrorMsg(e))
}
if (allowCSVDownload?.value) {

3
packages/nc-gui-v2/composables/useColumnCreateStore.ts

@ -35,8 +35,7 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState
title: 'title',
uidt: UITypes.SingleLineText,
...(column?.value || {}),
// todo: swagger json update - include meta
meta: (column?.value as any)?.meta || {},
meta: column?.value?.meta || {},
})
const additionalValidations = ref<Record<string, any>>({})

3
packages/nc-gui-v2/composables/useExpandedFormStore.ts

@ -84,9 +84,8 @@ const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState((m
await api.utils.commentRow({
fk_model_id: meta.value?.id as string,
row_id: rowId,
// todo: swagger type correction
description: comment.value,
} as any)
})
comment.value = ''
message.success('Comment added successfully')

2
packages/nc-gui-v2/composables/useGridViewColumnWidth.ts

@ -4,7 +4,6 @@ import type { Ref } from 'vue'
import { useMetas } from './useMetas'
import { useUIPermission } from './useUIPermission'
// todo: update swagger
export function useGridViewColumnWidth(view: Ref<(GridType & { id?: string }) | undefined>) {
const { css, load: loadCss, unload: unloadCss } = useStyleTag('')
const { isUIAllowed } = useUIPermission()
@ -18,7 +17,6 @@ export function useGridViewColumnWidth(view: Ref<(GridType & { id?: string }) |
const columns = computed<ColumnType[]>(() => metas?.value?.[(view?.value as any)?.fk_model_id as string]?.columns)
watch(
// todo : update type in swagger
[gridViewCols, resizingCol, resizingColWidth],
() => {
let style = ''

6
packages/nc-gui-v2/composables/useLTARStore.ts

@ -94,14 +94,13 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState(
rowId.value,
colOptions.type as 'mm' | 'hm',
column?.value?.title,
// todo: swagger type correction
{
limit: childrenExcludedListPagination.size,
offset: childrenExcludedListPagination.size * (childrenExcludedListPagination.page - 1),
where:
childrenExcludedListPagination.query &&
`(${relatedTablePrimaryValueProp.value},like,${childrenExcludedListPagination.query})`,
} as any,
},
)
}
} catch (e: any) {
@ -123,12 +122,11 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState(
rowId.value,
colOptions.type as 'mm' | 'hm',
column?.value?.title,
// todo: swagger type correction
{
limit: childrenListPagination.size,
offset: childrenListPagination.size * (childrenListPagination.page - 1),
where: childrenListPagination.query && `(${relatedTablePrimaryValueProp.value},like,${childrenListPagination.query})`,
} as any,
},
)
} catch (e: any) {
notification.error({

8
packages/nc-gui-v2/composables/useViewColumns.ts

@ -94,16 +94,14 @@ export function useViewColumns(
const showSystemFields = computed({
get() {
// todo: update swagger
return (view?.value as any)?.show_system_fields || false
return view?.value?.show_system_fields || false
},
set(v) {
set(v: boolean) {
if (view?.value?.id) {
$api.dbView
.update(view.value.id, {
// todo: update swagger
show_system_fields: v,
} as any)
})
.finally(() => reloadData?.())
;(view.value as any).show_system_fields = v
}

6
packages/nc-gui-v2/composables/useViewFilters.ts

@ -10,7 +10,6 @@ export function useViewFilters(
reloadData?: () => void,
shared = false,
) {
// todo: update swagger
const filters = ref<(FilterType & { status?: 'update' | 'delete' | 'create'; parentId?: string })[]>([])
const { $api } = useNuxtApp()
@ -79,11 +78,10 @@ export function useViewFilters(
fk_parent_id: parentId,
})
} else {
// todo: return type correction
filters.value[i] = (await $api.dbTableFilter.create(view?.value?.id as string, {
filters.value[i] = await $api.dbTableFilter.create(view?.value?.id as string, {
...filter,
fk_parent_id: parentId,
})) as any
})
}
reloadData?.()
}

3
packages/nc-gui-v2/composables/useViewSorts.ts

@ -12,8 +12,7 @@ export function useViewSorts(
const loadSorts = async () => {
if (!view?.value) return
// todo: api correction
sorts.value = ((await $api.dbTableSort.list(view?.value?.id as string)) as any)?.sorts?.list as any[]
sorts.value = ((await $api.dbTableSort.list(view?.value?.id as string)) as any)?.sorts?.list
}
const saveOrUpdate = async (sort: SortType, i: number) => {

23
packages/nocodb-sdk/src/lib/Api.ts

@ -1938,7 +1938,7 @@ export class Api<
*/
update: (
viewId: string,
data: { password?: string },
data: { password?: string; meta?: any },
params: RequestParams = {}
) =>
this.request<SharedViewType, any>({
@ -2026,10 +2026,10 @@ export class Api<
* @tags DB table sort
* @name List
* @request GET:/api/v1/db/meta/views/{viewId}/sorts
* @response `200` `{ uuid?: string, url?: string }` OK
* @response `200` `{ sorts?: { list?: (SortType)[] } }` OK
*/
list: (viewId: string, params: RequestParams = {}) =>
this.request<{ uuid?: string; url?: string }, any>({
this.request<{ sorts?: { list?: SortType[] } }, any>({
path: `/api/v1/db/meta/views/${viewId}/sorts`,
method: 'GET',
format: 'json',
@ -2124,14 +2124,15 @@ export class Api<
* @tags DB table filter
* @name Create
* @request POST:/api/v1/db/meta/views/{viewId}/filters
* @response `200` `void` OK
* @response `200` `FilterType` OK
*/
create: (viewId: string, data: FilterType, params: RequestParams = {}) =>
this.request<void, any>({
this.request<FilterType, any>({
path: `/api/v1/db/meta/views/${viewId}/filters`,
method: 'POST',
body: data,
type: ContentType.Json,
format: 'json',
...params,
}),
@ -2594,7 +2595,11 @@ export class Api<
rowId: string,
relationType: 'mm' | 'hm',
columnName: string,
query?: { limit?: string; offset?: string },
query?: {
limit?: string | number;
offset?: string | number;
where?: string;
},
params: RequestParams = {}
) =>
this.request<any, any>({
@ -2675,7 +2680,11 @@ export class Api<
rowId: string,
relationType: 'mm' | 'hm',
columnName: string,
query?: { limit?: string; offset?: string },
query?: {
limit?: string | number;
offset?: string | number;
where?: string;
},
params: RequestParams = {}
) =>
this.request<any, any>({

94
scripts/sdk/swagger.json

@ -942,27 +942,28 @@
"post": {
"summary": "",
"operationId": "project-shared-base-create",
"responses": { "200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"uuid": {
"type": "string"
},
"url": {
"type": "string"
},
"roles": {
"type": "string"
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"uuid": {
"type": "string"
},
"url": {
"type": "string"
},
"roles": {
"type": "string"
}
}
}
}
}
}
}
},
"tags": [
"Project"
@ -1726,7 +1727,8 @@
"properties": {
"password": {
"type": "string"
}
},
"meta": {}
}
}
}
@ -1851,11 +1853,16 @@
"schema": {
"type": "object",
"properties": {
"uuid": {
"type": "string"
},
"url": {
"type": "string"
"sorts": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Sort"
}
}
}
}
}
}
@ -1991,7 +1998,14 @@
"operationId": "db-table-filter-create",
"responses": {
"200": {
"description": "OK"
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Filter"
}
}
}
}
},
"tags": [
@ -3831,17 +3845,30 @@
"parameters": [
{
"schema": {
"type": "string"
"type": [
"string",
"number"
]
},
"in": "query",
"name": "limit"
},
{
"schema": {
"type": "string"
"type": [
"string",
"number"
]
},
"in": "query",
"name": "offset"
},
{
"schema": {
"type": "string"
},
"in": "query",
"name": "where"
}
]
}
@ -4035,17 +4062,30 @@
"parameters": [
{
"schema": {
"type": "string"
"type": [
"string",
"number"
]
},
"in": "query",
"name": "limit"
},
{
"schema": {
"type": "string"
"type": [
"string",
"number"
]
},
"in": "query",
"name": "offset"
},
{
"schema": {
"type": "string"
},
"in": "query",
"name": "where"
}
]
}

Loading…
Cancel
Save