Created
March 27, 2021 00:13
-
-
Save TRahulSam1997/364cc73f6e82d939e75f07fd5786cde8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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