mirror of
https://github.com/eliasstepanik/core.git
synced 2026-01-11 00:18:26 +00:00
11 lines
391 B
TypeScript
11 lines
391 B
TypeScript
import { json, type LoaderFunctionArgs } from "@remix-run/node";
|
|
import { getNodeLinks } from "~/lib/neo4j.server";
|
|
|
|
export async function loader({ request }: LoaderFunctionArgs) {
|
|
const url = new URL(request.url);
|
|
const userId = url.searchParams.get("userId");
|
|
if (!userId) return json([], { status: 400 });
|
|
const nodeLinks = await getNodeLinks(userId);
|
|
return json(nodeLinks);
|
|
}
|