budibase/packages/component-sdk/src/api/tables.js

17 lines
406 B
JavaScript
Raw Normal View History

import api from "./api"
/**
* Fetches a table definition.
* Since definitions cannot change at runtime, the result is cached.
*/
export const fetchTableDefinition = async tableId => {
return await api.get({ url: `/api/tables/${tableId}`, cache: true })
}
/**
* Fetches all rows from a table.
*/
export const fetchTableData = async name => {
return await api.get({ url: `/api/views/${name}` })
}