Skip to content

Commit

Permalink
Add offset and pageSize with the selected formula
Browse files Browse the repository at this point in the history
  • Loading branch information
parthy007 committed May 24, 2024
1 parent 298dd8b commit e65c1d2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions plugins/packages/airtable/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ export default class AirtableQueryService implements QueryService {
const filterFormula = queryOptions.filter_by_formula || '';

if (filterFormula) {
response = await got(
`https://api.airtable.com/v0/${baseId}/${tableName}/listRecords/?pageSize=${pageSize}&offset=${offset}`,
{
method: 'post',
headers: this.authHeader(apiToken),
json: {
filterByFormula: filterFormula,
},
}
);
const page_size = Number(pageSize);
response = await got(`https://api.airtable.com/v0/${baseId}/${tableName}/listRecords`, {
method: 'post',
headers: this.authHeader(apiToken),
json: {
filterByFormula: filterFormula,
pageSize: page_size,
offset: offset,
},
});
} else {
response = await got(
`https://api.airtable.com/v0/${baseId}/${tableName}/?pageSize=${pageSize}&offset=${offset}`,
Expand Down

0 comments on commit e65c1d2

Please sign in to comment.