Skip to content

Instantly share code, notes, and snippets.

@TRahulSam1997
Created March 27, 2021 00:13
Show Gist options
  • Save TRahulSam1997/364cc73f6e82d939e75f07fd5786cde8 to your computer and use it in GitHub Desktop.
Save TRahulSam1997/364cc73f6e82d939e75f07fd5786cde8 to your computer and use it in GitHub Desktop.
const airtable = require('airtable');
const base = new airtable({apiKey: `${process.env.AIRTABLE_API_KEY}`}).base(`${process.env.AIRTABLE_BASE_ID}`);
const table = base(`${process.env.AIRTABLE_TABLE_NAME}`);
const minifyRecords = (records) => {
return records.map((record) => getMinifiedRecord(record));
};
const getMinifiedRecord = (record) => {
return {
id: record.id,
fields: record.fields,
};
};
export { table, getMinifiedRecord, minifyRecords };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment