Process bb_references on external

This commit is contained in:
Adria Navarro 2023-09-27 13:08:46 +02:00
parent af0aa28bfa
commit 81ca81222c
2 changed files with 10 additions and 2 deletions

View File

@ -18,7 +18,10 @@ import {
import sdk from "../../../sdk"
import * as utils from "./utils"
import { dataFilters } from "@budibase/shared-core"
import { inputProcessing } from "../../../utilities/rowProcessor"
import {
inputProcessing,
outputProcessing,
} from "../../../utilities/rowProcessor"
import { cloneDeep, isEqual } from "lodash"
export async function handleRequest(
@ -121,7 +124,8 @@ export async function find(ctx: UserCtx): Promise<Row> {
ctx.throw(404)
}
return row
const table = await sdk.tables.getTable(tableId)
return await outputProcessing(table, row)
}
export async function destroy(ctx: UserCtx) {

View File

@ -17,6 +17,7 @@ import { utils } from "@budibase/shared-core"
import { ExportRowsParams, ExportRowsResult } from "../search"
import { HTTPError, db } from "@budibase/backend-core"
import pick from "lodash/pick"
import { outputProcessing } from "../../../../utilities/rowProcessor"
export async function search(options: SearchParams) {
const { tableId } = options
@ -75,6 +76,9 @@ export async function search(options: SearchParams) {
rows = rows.map((r: any) => pick(r, fields))
}
const table = await sdk.tables.getTable(tableId)
rows = await outputProcessing(table, rows)
// need wrapper object for bookmarks etc when paginating
return { rows, hasNextPage, bookmark: bookmark && bookmark + 1 }
} catch (err: any) {