Fix throwing 404

This commit is contained in:
Adria Navarro 2024-07-23 15:27:35 +02:00
parent 4169842018
commit 8a8633b43b
1 changed files with 5 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import { IncludeRelationship, Operation, Row } from "@budibase/types"
import { HTTPError } from "@budibase/backend-core"
import { handleRequest } from "../../../api/controllers/row/external"
import { breakRowIdField } from "../../../integrations/utils"
import sdk from "../../../sdk"
@ -73,6 +74,10 @@ export async function find(tableId: string, rowId: string): Promise<Row> {
relationships: true,
})
if (!row) {
throw new HTTPError("Row not found", 404)
}
const table = await sdk.tables.getTable(tableId)
// Preserving links, as the outputProcessing does not support external rows yet and we don't need it in this use case
return await outputProcessing(table, row, {