Skip to content

Instantly share code, notes, and snippets.

@TRahulSam1997
Created March 28, 2021 02:37
Show Gist options
  • Save TRahulSam1997/acc21159efe7135d14301e3b1c3ea73f to your computer and use it in GitHub Desktop.
Save TRahulSam1997/acc21159efe7135d14301e3b1c3ea73f to your computer and use it in GitHub Desktop.
import { table, minifyRecords } from './utils/airtable';
export default async (req, res) => {
try {
const records = await table.select({}).firstPage();
const minifiedRecords = minifyRecords(records);
res.statusCode = 200;
res.json(minifiedRecords);
} catch (err) {
res.statusCode = 500;
res.json({ msg: 'Something went wrong' });
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment