Fix search returning non visible columns
This commit is contained in:
parent
882a056cd9
commit
53af94f971
|
@ -25,7 +25,9 @@ export async function searchView(
|
||||||
ctx.throw(400, `This method only supports viewsV2`)
|
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
|
const { body } = ctx.request
|
||||||
|
|
||||||
// Enrich saved query with ephemeral query params.
|
// Enrich saved query with ephemeral query params.
|
||||||
|
|
|
@ -879,14 +879,14 @@ describe.each([
|
||||||
view = await config.api.viewV2.get(view.id)
|
view = await config.api.viewV2.get(view.id)
|
||||||
await config.api.viewV2.update(
|
await config.api.viewV2.update(
|
||||||
{
|
{
|
||||||
...view,
|
...view,
|
||||||
schema: {
|
schema: {
|
||||||
...view.schema,
|
...view.schema,
|
||||||
Price: {
|
Price: {
|
||||||
visible: false,
|
visible: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
{
|
{
|
||||||
status: 400,
|
status: 400,
|
||||||
body: {
|
body: {
|
||||||
|
@ -1201,6 +1201,7 @@ describe.each([
|
||||||
],
|
],
|
||||||
schema: {
|
schema: {
|
||||||
id: { visible: true },
|
id: { visible: true },
|
||||||
|
one: { visible: false },
|
||||||
two: { visible: true },
|
two: { visible: true },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue