1
0
Fork 0
mirror of synced 2024-09-20 11:27:56 +12:00

Clean unnecessary ctx

This commit is contained in:
Adria Navarro 2024-07-23 15:06:00 +02:00
parent 89173be9f4
commit 66a2b29ca2
2 changed files with 4 additions and 5 deletions

View file

@ -32,7 +32,7 @@ export async function patch(ctx: UserCtx<PatchRowRequest, PatchRowResponse>) {
try {
oldRow = await outputProcessing(
dbTable,
await utils.findRow(ctx, tableId, inputs._id!)
await utils.findRow(tableId, inputs._id!)
)
} catch (err) {
if (isUserTable) {
@ -100,7 +100,7 @@ export async function find(ctx: UserCtx): Promise<Row> {
const tableId = utils.getTableId(ctx),
rowId = ctx.params.rowId
const table = await sdk.tables.getTable(tableId)
let row = await utils.findRow(ctx, tableId, rowId)
let row = await utils.findRow(tableId, rowId)
row = await outputProcessing(table, row)
return row
}
@ -195,7 +195,7 @@ export async function fetchEnrichedRow(ctx: UserCtx) {
sdk.tables.getTable(tableId),
linkRows.getLinkDocuments({ tableId, rowId, fieldName }),
])
let row = await utils.findRow(ctx, tableId, rowId)
let row = await utils.findRow(tableId, rowId)
row = await outputProcessing(table, row)
const linkVals = links as LinkDocumentValue[]

View file

@ -8,7 +8,6 @@ import {
RelationshipsJson,
Row,
Table,
UserCtx,
} from "@budibase/types"
import {
processDates,
@ -64,7 +63,7 @@ export async function processRelationshipFields(
return row
}
export async function findRow(ctx: UserCtx, tableId: string, rowId: string) {
export async function findRow(tableId: string, rowId: string) {
const db = context.getAppDB()
let row: Row
// TODO remove special user case in future