From 4050a233992a47a85b75ca8985d52eaf74d4820e Mon Sep 17 00:00:00 2001 From: zhangtao25 Date: Fri, 15 Nov 2024 19:52:22 +0800 Subject: [PATCH] chore: repo overall update --- .../canyon-platform/app/api/project/route.ts | 19 ++++++++++++++++ .../canyon-platform/app/api/user/route.ts | 4 ++-- .../canyon-platform/app/projects/page.tsx | 22 ++++++++++++------- 3 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 packages/canyon-platform/app/api/project/route.ts diff --git a/packages/canyon-platform/app/api/project/route.ts b/packages/canyon-platform/app/api/project/route.ts new file mode 100644 index 00000000..c0dd48a3 --- /dev/null +++ b/packages/canyon-platform/app/api/project/route.ts @@ -0,0 +1,19 @@ +// export const dynamic = 'force-static' +// import prisma from "@/lib/prisma"; +// import {decompressedData} from "@/utils/zstd"; + +export async function GET() { + + + return Response.json({ + data:[ + { + id:'id', + pathWithNamespace:'canyon/canyon', + description:'sss', + lastReported:'2024-04-30' + } + ] + }) + +} diff --git a/packages/canyon-platform/app/api/user/route.ts b/packages/canyon-platform/app/api/user/route.ts index 5b066487..0c1bc113 100644 --- a/packages/canyon-platform/app/api/user/route.ts +++ b/packages/canyon-platform/app/api/user/route.ts @@ -2,7 +2,7 @@ import prisma from "@/lib/prisma"; export async function GET() { - const users = await prisma.user.findMany(); + // const users = await prisma.user.findMany(); - return Response.json({ data:users }) + return Response.json({ data:[] }) } diff --git a/packages/canyon-platform/app/projects/page.tsx b/packages/canyon-platform/app/projects/page.tsx index 3b225f71..83b524cb 100644 --- a/packages/canyon-platform/app/projects/page.tsx +++ b/packages/canyon-platform/app/projects/page.tsx @@ -13,27 +13,33 @@ const fetcher = (url) => axios(url).then((res) => res.data); const columns = [ { - title: '姓名', - dataIndex: 'username', - key: 'name', + title: 'ID', + dataIndex: 'id', + key: 'id', }, { - title: '年龄', - dataIndex: 'age', - key: 'age', + title: 'Repo', + dataIndex: 'pathWithNamespace', + key: 'pathWithNamespace', }, { - title: '住址', + title: 'Org', dataIndex: 'address', key: 'address', }, + { + title: 'Last Reported', + dataIndex: 'address', + key: 'address', + }, + // Last Reported ]; const ProjectsPage = () => { const { token } = useToken(); // const users = await prisma.user.findMany(); // console.log(users.length); const { data, error, isLoading } = useSWR( - "/api/user", + "/api/project", fetcher );