Test updated
This commit is contained in:
parent
d75f1debda
commit
275d358df9
|
@ -38,7 +38,7 @@ export async function handleRequest<T extends Operation>(
|
|||
}
|
||||
|
||||
export async function patch(ctx: UserCtx<PatchRowRequest, PatchRowResponse>) {
|
||||
const { tableId } = utils.getSourceId(ctx)
|
||||
const { tableId, viewId } = utils.getSourceId(ctx)
|
||||
|
||||
const { _id, ...rowData } = ctx.request.body
|
||||
const table = await sdk.tables.getTable(tableId)
|
||||
|
@ -77,6 +77,7 @@ export async function patch(ctx: UserCtx<PatchRowRequest, PatchRowResponse>) {
|
|||
outputProcessing(table, row, {
|
||||
squash: true,
|
||||
preserveLinks: true,
|
||||
fromViewId: viewId,
|
||||
}),
|
||||
outputProcessing(table, beforeRow, {
|
||||
squash: true,
|
||||
|
|
|
@ -23,7 +23,7 @@ import { getLinkedTableIDs } from "../../../db/linkedRows/linkUtils"
|
|||
import { flatten } from "lodash"
|
||||
|
||||
export async function patch(ctx: UserCtx<PatchRowRequest, PatchRowResponse>) {
|
||||
const { tableId } = utils.getSourceId(ctx)
|
||||
const { tableId, viewId } = utils.getSourceId(ctx)
|
||||
const inputs = ctx.request.body
|
||||
const isUserTable = tableId === InternalTables.USER_METADATA
|
||||
let oldRow
|
||||
|
@ -90,6 +90,7 @@ export async function patch(ctx: UserCtx<PatchRowRequest, PatchRowResponse>) {
|
|||
const result = await finaliseRow(table, row, {
|
||||
oldTable: dbTable,
|
||||
updateFormula: true,
|
||||
fromViewId: viewId,
|
||||
})
|
||||
|
||||
return { ...result, oldRow }
|
||||
|
|
|
@ -2619,6 +2619,7 @@ describe.each([
|
|||
},
|
||||
],
|
||||
["from original saved row", (row: Row) => row],
|
||||
["from updated row", (row: Row) => config.api.row.save(viewId, row)],
|
||||
]
|
||||
|
||||
it.each(testScenarios)(
|
||||
|
|
Loading…
Reference in New Issue