feat: node store interface
This commit is contained in:
22
app/src/routes/nodes/[user].json/+server.ts
Normal file
22
app/src/routes/nodes/[user].json/+server.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { json } from "@sveltejs/kit";
|
||||
import type { EntryGenerator, RequestHandler } from "./$types";
|
||||
import * as registry from "$lib/node-registry";
|
||||
|
||||
|
||||
export const prerender = true;
|
||||
|
||||
export const entries: EntryGenerator = async () => {
|
||||
const users = await registry.getUsers();
|
||||
return users.map(user => {
|
||||
return { user: user.id }
|
||||
}).flat(2);
|
||||
}
|
||||
|
||||
|
||||
export const GET: RequestHandler = async function GET({ params }) {
|
||||
|
||||
const namespaces = await registry.getUser(params.user)
|
||||
|
||||
return json(namespaces);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user