Spaces:
Runtime error
Runtime error
Download src/app/api/thread/route.ts from shyota/better-chatbot: direct link, hf CLI and curl.
- Browser
- Download file 369 Bytes
-
https://huggingface.co/spaces/shyota/better-chatbot/resolve/main/src/app/api/thread/route.ts
- Command line
-
hf download hf://spaces/shyota/better-chatbot/src/app/api/thread/route.ts
-
curl -L -o route.ts https://huggingface.co/spaces/shyota/better-chatbot/resolve/main/src/app/api/thread/route.ts
369 Bytes
| import { getSession } from "auth/server"; | |
| import { chatRepository } from "lib/db/repository"; | |
| export async function GET() { | |
| const session = await getSession(); | |
| if (!session?.user?.id) { | |
| return new Response("Unauthorized", { status: 401 }); | |
| } | |
| const threads = await chatRepository.selectThreadsByUserId(session.user.id); | |
| return Response.json(threads); | |
| } | |