feat: set up mock data to be used to generate baseline profiles

This commit is contained in:
2025-12-06 07:27:14 -05:00
parent 9d71199943
commit ad26cd6da3
9 changed files with 239 additions and 62 deletions

View File

@@ -46,6 +46,14 @@ app.openapi(route, async (c) => {
const aniListId = Number(c.req.query("id"));
const aniListToken = c.req.header("X-AniList-Token");
// Check if we should use mock data
const { useMockData } = await import("~/libs/useMockData");
if (useMockData()) {
const { mockTitleDetails } = await import("~/mocks/mockData");
return c.json({ success: true, result: mockTitleDetails() }, 200);
}
const { result: title, errorOccurred } = await fetchFromMultipleSources([
() => fetchTitleFromAnilist(aniListId, aniListToken ?? undefined),
]);