|
|
@ -1,4 +1,3 @@ |
|
|
import { requireLogin } from "@/app/api/_auth"; |
|
|
|
|
|
import { NextRequest, NextResponse } from "next/server"; |
|
|
import { NextRequest, NextResponse } from "next/server"; |
|
|
|
|
|
|
|
|
const UPSTREAM_CATEGORY_LIST_PATH = "/api_client/canvas/template/category/list"; |
|
|
const UPSTREAM_CATEGORY_LIST_PATH = "/api_client/canvas/template/category/list"; |
|
|
@ -22,12 +21,8 @@ export async function GET(request: NextRequest) { |
|
|
"keyword", |
|
|
"keyword", |
|
|
request.nextUrl.searchParams.get("keyword") || "", |
|
|
request.nextUrl.searchParams.get("keyword") || "", |
|
|
); |
|
|
); |
|
|
const { token } = requireLogin(request); |
|
|
|
|
|
const response = await fetch(upstreamUrl, { |
|
|
const response = await fetch(upstreamUrl, { |
|
|
method: "GET", |
|
|
method: "GET", |
|
|
headers: { |
|
|
|
|
|
authorization: `Bearer ${token}`, |
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
}); |
|
|
const body = await response.text(); |
|
|
const body = await response.text(); |
|
|
|
|
|
|
|
|
|