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 fetchAllMovies = async () => {
|
||||
try {
|
||||
return await EleventyFetch(`${POSTGREST_URL}/optimized_movies?select=*`, {
|
||||
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 movies:", error);
|
||||
console.error('Error fetching movies:', error);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
@ -44,19 +44,17 @@ export default async function () {
|
|||
movies,
|
||||
watchHistory: movies.filter((movie) => movie.last_watched),
|
||||
recentlyWatched: recentlyWatchedMovies,
|
||||
favorites: favoriteMovies.sort((a, b) =>
|
||||
a.title.localeCompare(b.title),
|
||||
),
|
||||
feed: movies.filter((movie) => movie.feed),
|
||||
favorites: favoriteMovies.sort((a, b) => a.title.localeCompare(b.title)),
|
||||
feed: movies.filter((movie) => movie.feed)
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("Error fetching and processing movies data:", error);
|
||||
console.error('Error fetching and processing movies data:', error);
|
||||
return {
|
||||
movies: [],
|
||||
watchHistory: [],
|
||||
recentlyWatched: [],
|
||||
favorites: [],
|
||||
feed: [],
|
||||
feed: []
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue