Created
May 5, 2021 08:51
-
-
Save mkhmylife/0f6ec93b02b55752f9675633187ac6e6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
export interface AirtableConfig { | |
route: string; | |
base: string; | |
table: string; | |
view?: string; | |
filter?: string; | |
fields: string[]; | |
fieldMappings?: Function; | |
} | |
export const airtableConfigs: Array<AirtableConfig> = [ | |
{ | |
route: "posts", | |
base: "app123456", | |
table: "Table Name", | |
filter: "Status = 'Published'", | |
fields: [ | |
'ID', | |
'First Name', | |
'Last Name', | |
'Content', | |
], | |
fieldMappings: ((records: any[]) => { | |
return records.map( (record: any) => { | |
return { | |
id: record.ID, | |
name: `${record['First Name']} ${record['Last Name']}`, | |
content: record.Content, | |
} | |
}) | |
}), | |
}, | |
{ | |
route: "settings", | |
base: "app123456", | |
table: "Table Name", | |
filter: "Status = 'Published'", | |
fields: [ | |
"Key", | |
"Value", | |
], | |
}, | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment