- offer to create tag when none is found while adding a link from cli - fix tag display in search
29 lines
740 B
JavaScript
29 lines
740 B
JavaScript
import EleventyFetch from "@11ty/eleventy-fetch";
|
|
|
|
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
|
|
|
|
const fetchUpcomingShows = async () => {
|
|
try {
|
|
return await EleventyFetch(`${POSTGREST_URL}/optimized_scheduled_shows?select=*`, {
|
|
duration: "1h",
|
|
type: "json",
|
|
fetchOptions: {
|
|
method: "GET",
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
Authorization: `Bearer ${POSTGREST_API_KEY}`
|
|
}
|
|
}
|
|
});
|
|
} catch (error) {
|
|
console.error("Error fetching upcoming shows:", error);
|
|
return [];
|
|
}
|
|
};
|
|
|
|
export default async function () {
|
|
const data = await fetchUpcomingShows();
|
|
const upcomingShows = data?.[0]?.scheduled_shows;
|
|
|
|
return upcomingShows;
|
|
}
|