Skip to content

Commit

Permalink
Removes hardcodes category names
Browse files Browse the repository at this point in the history
Uses special category names from DB to create the special table fetches
  • Loading branch information
cmdalbem committed Dec 27, 2020
1 parent 4378507 commit ffa10f8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions api/Airtable.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,14 @@ class Airtable {
async get() {
await this.buildCategories();

await this.fetchSpecialCategory('Still');
await this.fetchSpecialCategory('Nature');
await this.fetchSpecialCategory('Urban');
for (const k of Object.keys(this.categories)) {
const c = this.categories[k];
if (c.fields.type === 'special') {
const viewName = c.fields['title-en'];
console.debug('Fetching special category:', viewName)
await this.fetchSpecialCategory(viewName);
}
}

const videos = await this.fetchTable('Videos','Filtered');
if (videos && videos.length > 0) {
Expand Down

0 comments on commit ffa10f8

Please sign in to comment.