1
0
Fork 0
mirror of synced 2024-10-04 03:54:37 +13:00

Fix controller

This commit is contained in:
Adria Navarro 2023-07-24 16:35:22 +02:00
parent 5bd149f66f
commit 7465c04799
2 changed files with 5 additions and 3 deletions

View file

@ -161,8 +161,10 @@ export async function searchView(ctx: Ctx<void, SearchResponse>) {
const table = await sdk.tables.getTable(view?.tableId)
const viewFields =
view.columns?.length &&
Object.keys(sdk.views.enrichSchema(view, table.schema).schema)
(view.columns &&
Object.entries(view.columns).length &&
Object.keys(sdk.views.enrichSchema(view, table.schema).schema)) ||
undefined
ctx.status = 200
ctx.body = await quotas.addQuery(

View file

@ -856,7 +856,7 @@ describe("/rows", () => {
}
const createViewResponse = await config.api.viewV2.create({
columns: ["name"],
columns: { name: { visible: true } },
})
const response = await config.api.viewV2.search(createViewResponse.id)