mirror of
https://github.com/eliasstepanik/core.git
synced 2026-01-11 18:38:27 +00:00
* feat: Episode ingestion update Benchmarking CORE * Feat: Spaces in knowledge graph * fix: remove daily assignment * Feat: add spaces * Feat: spaces --------- Co-authored-by: Manoj K <saimanoj58@gmail.com>
29 lines
781 B
TypeScript
29 lines
781 B
TypeScript
import { type LoaderFunctionArgs, json } from "@remix-run/node";
|
|
|
|
import { getEpisodeFacts } from "~/services/episodeFacts.server";
|
|
import { requireUser } from "~/services/session.server";
|
|
|
|
export async function loader({ request, params }: LoaderFunctionArgs) {
|
|
try {
|
|
const user = await requireUser(request);
|
|
const { episodeId } = params;
|
|
|
|
if (!episodeId) {
|
|
return json(
|
|
{ success: false, error: "Episode ID is required" },
|
|
{ status: 400 },
|
|
);
|
|
}
|
|
|
|
const result = await getEpisodeFacts(episodeId, user.id);
|
|
|
|
return json(result);
|
|
} catch (error) {
|
|
console.error("Error in episodes facts API:", error);
|
|
return json(
|
|
{ success: false, error: "Internal server error", facts: [] },
|
|
{ status: 500 },
|
|
);
|
|
}
|
|
}
|