Fix search returning non visible columns

This commit is contained in:
Adria Navarro 2024-07-02 14:02:16 +02:00
parent 882a056cd9
commit 53af94f971
2 changed files with 10 additions and 7 deletions

View File

@ -25,7 +25,9 @@ export async function searchView(
ctx.throw(400, `This method only supports viewsV2`)
}
const viewFields = Object.keys(view.schema || {})
const viewFields = Object.entries(view.schema || {})
.filter(([_, value]) => value.visible)
.map(([key]) => key)
const { body } = ctx.request
// Enrich saved query with ephemeral query params.

View File

@ -1201,6 +1201,7 @@ describe.each([
],
schema: {
id: { visible: true },
one: { visible: false },
two: { visible: true },
},
})