|
|
|
@ -3,7 +3,6 @@ import { fetchTableData } from "./tables" |
|
|
|
import { fetchViewData } from "./views" |
|
|
|
import { fetchRelationshipData } from "./relationships" |
|
|
|
import { executeQuery } from "./queries" |
|
|
|
import { enrichRows } from "./rows" |
|
|
|
|
|
|
|
/** |
|
|
|
* Fetches all rows for a particular Budibase data source. |
|
|
|
@ -28,7 +27,7 @@ export const fetchDatasource = async datasource => { |
|
|
|
parameters[param.name] = param.default |
|
|
|
} |
|
|
|
} |
|
|
|
return await executeQuery({ queryId: datasource._id, parameters }) |
|
|
|
rows = await executeQuery({ queryId: datasource._id, parameters }) |
|
|
|
} else if (type === "link") { |
|
|
|
rows = await fetchRelationshipData({ |
|
|
|
rowId: datasource.rowId, |
|
|
|
@ -37,6 +36,6 @@ export const fetchDatasource = async datasource => { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// Enrich rows so they can displayed properly
|
|
|
|
return await enrichRows(rows, tableId) |
|
|
|
// Enrich the result is always an array
|
|
|
|
return Array.isArray(rows) ? rows : [] |
|
|
|
} |
|
|
|
|