chore(*): use prettier for formatting
This commit is contained in:
parent
6c659fe1d0
commit
029caaaa9e
73 changed files with 1390 additions and 794 deletions
|
@ -1,22 +1,22 @@
|
|||
import EleventyFetch from "@11ty/eleventy-fetch";
|
||||
import EleventyFetch from '@11ty/eleventy-fetch';
|
||||
|
||||
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
|
||||
|
||||
const fetchAllConcerts = async () => {
|
||||
try {
|
||||
return await EleventyFetch(`${POSTGREST_URL}/optimized_concerts`, {
|
||||
duration: "1h",
|
||||
type: "json",
|
||||
duration: '1h',
|
||||
type: 'json',
|
||||
fetchOptions: {
|
||||
method: "GET",
|
||||
method: 'GET',
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `Bearer ${POSTGREST_API_KEY}`,
|
||||
},
|
||||
},
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${POSTGREST_API_KEY}`
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Error fetching concerts:", error);
|
||||
console.error('Error fetching concerts:', error);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
@ -24,7 +24,7 @@ const fetchAllConcerts = async () => {
|
|||
const processConcerts = (concerts) =>
|
||||
concerts.map((concert) => ({
|
||||
...concert,
|
||||
artist: concert.artist || { name: concert.artist_name_string, url: null },
|
||||
artist: concert.artist || { name: concert.artist_name_string, url: null }
|
||||
}));
|
||||
|
||||
export default async function () {
|
||||
|
@ -32,7 +32,7 @@ export default async function () {
|
|||
const concerts = await fetchAllConcerts();
|
||||
return processConcerts(concerts);
|
||||
} catch (error) {
|
||||
console.error("Error fetching and processing concerts data:", error);
|
||||
console.error('Error fetching and processing concerts data:', error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue