//native
type Nocodb = {
apiUrl: string;
xc_token: string;
table: string;
workspace: string;
};
export async function main(nocodb: Nocodb, limit: number) {
// request from nocodb
const res = await fetch(
`${nocodb.apiUrl}/api/v1/db/data/v1/${nocodb.workspace}/${nocodb.table}?limit=${limit}`,
{
headers: {
"Content-Type": "application/json",
"xc-token": nocodb.xc_token,
},
},
);
const data = await res.json();
return data;
}
Submitted by hugo989 5 days ago