Added boob and country aggregation to actors page.

This commit is contained in:
2023-12-31 03:02:03 +01:00
parent b5a730764c
commit 6408365933
276 changed files with 37792 additions and 166 deletions

15
src/countries.js Normal file
View File

@@ -0,0 +1,15 @@
import knex from './knex.js';
function curateCountry(countryEntry) {
return {
name: countryEntry.name,
alpha2: countryEntry.alpha2,
code: countryEntry.code,
};
}
export async function fetchCountriesByAlpha2(alpha2s) {
const entries = await knex('countries').whereIn('alpha2', alpha2s);
return entries.map((entry) => curateCountry(entry));
}