Fix link loading relationships on external ds+
This commit is contained in:
parent
7fedb8491c
commit
5b5c0b31ff
|
@ -72,10 +72,15 @@ export async function patch(ctx: UserCtx<PatchRowRequest, PatchRowResponse>) {
|
|||
id: breakRowIdField(_id),
|
||||
row: dataToUpdate,
|
||||
})
|
||||
const row = await outputProcessing(table, response.row)
|
||||
const row = await sdk.rows.external.getRow(tableId, _id, {
|
||||
relationships: true,
|
||||
})
|
||||
const enrichedRow = await outputProcessing(table, row, {
|
||||
preserveLinks: true,
|
||||
})
|
||||
return {
|
||||
...response,
|
||||
row,
|
||||
row: enrichedRow,
|
||||
table,
|
||||
}
|
||||
}
|
||||
|
@ -116,7 +121,7 @@ export async function save(ctx: UserCtx) {
|
|||
})
|
||||
return {
|
||||
...response,
|
||||
row: await outputProcessing(table, row),
|
||||
row: await outputProcessing(table, row, { preserveLinks: true }),
|
||||
}
|
||||
} else {
|
||||
return response
|
||||
|
|
|
@ -77,7 +77,7 @@ export async function search(options: SearchParams) {
|
|||
}
|
||||
|
||||
const table = await sdk.tables.getTable(tableId)
|
||||
rows = await outputProcessing(table, rows)
|
||||
rows = await outputProcessing(table, rows, { preserveLinks: true })
|
||||
|
||||
// need wrapper object for bookmarks etc when paginating
|
||||
return { rows, hasNextPage, bookmark: bookmark && bookmark + 1 }
|
||||
|
@ -174,7 +174,7 @@ export async function fetch(tableId: string) {
|
|||
includeSqlRelationships: IncludeRelationship.INCLUDE,
|
||||
})
|
||||
const table = await sdk.tables.getTable(tableId)
|
||||
return await outputProcessing(table, response)
|
||||
return await outputProcessing(table, response, { preserveLinks: true })
|
||||
}
|
||||
|
||||
export async function fetchView(viewName: string) {
|
||||
|
|
Loading…
Reference in New Issue