18 lines
580 B
TypeScript
18 lines
580 B
TypeScript
import { IncludeRelationship, Operation, Row } from "@budibase/types"
|
|
import { handleRequest } from "../../../api/controllers/row/external"
|
|
import { breakRowIdField } from "../../../integrations/utils"
|
|
|
|
export async function getRow(
|
|
tableId: string,
|
|
rowId: string,
|
|
opts?: { relationships?: boolean }
|
|
) {
|
|
const response = await handleRequest(Operation.READ, tableId, {
|
|
id: breakRowIdField(rowId),
|
|
includeSqlRelationships: opts?.relationships
|
|
? IncludeRelationship.INCLUDE
|
|
: IncludeRelationship.EXCLUDE,
|
|
})
|
|
return response ? response[0] : response
|
|
}
|