1
0
Fork 0
mirror of synced 2024-09-17 17:57:47 +12:00

Default state of view is no data returned.

This commit is contained in:
mike12345567 2023-08-11 16:01:53 +01:00
parent 9e0964a5e3
commit 672e370904
2 changed files with 14 additions and 16 deletions

View file

@ -82,7 +82,6 @@ export function enrichSchema(view: View | ViewV2, tableSchema: TableSchema) {
const anyViewOrder = Object.values(view.schema || {}).some( const anyViewOrder = Object.values(view.schema || {}).some(
ui => ui.order != null ui => ui.order != null
) )
if (Object.keys(view.schema || {}).length > 0) {
for (const key of Object.keys(schema)) { for (const key of Object.keys(schema)) {
// if nothing specified in view, then it is not visible // if nothing specified in view, then it is not visible
const ui = view.schema?.[key] || { visible: false } const ui = view.schema?.[key] || { visible: false }
@ -96,7 +95,6 @@ export function enrichSchema(view: View | ViewV2, tableSchema: TableSchema) {
} }
} }
} }
}
return { return {
...view, ...view,

View file

@ -49,7 +49,7 @@ describe("table sdk", () => {
} }
describe("enrichViewSchemas", () => { describe("enrichViewSchemas", () => {
it("should fetch the default schema if not overriden", async () => { it("should fetch the default schema if not overridden", async () => {
const tableId = basicTable._id! const tableId = basicTable._id!
const view: ViewV2 = { const view: ViewV2 = {
version: 2, version: 2,
@ -66,7 +66,7 @@ describe("table sdk", () => {
name: { name: {
type: "string", type: "string",
name: "name", name: "name",
visible: true, visible: false,
order: 2, order: 2,
width: 80, width: 80,
constraints: { constraints: {
@ -76,7 +76,7 @@ describe("table sdk", () => {
description: { description: {
type: "string", type: "string",
name: "description", name: "description",
visible: true, visible: false,
width: 200, width: 200,
constraints: { constraints: {
type: "string", type: "string",
@ -85,7 +85,7 @@ describe("table sdk", () => {
id: { id: {
type: "number", type: "number",
name: "id", name: "id",
visible: true, visible: false,
order: 1, order: 1,
constraints: { constraints: {
type: "number", type: "number",