the cleanup
This commit is contained in:
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
const API_BASE_URL =
|
||||
process.env.NEXT_PUBLIC_API_BASE_URL ?? "http://localhost:8080";
|
||||
process.env.NEXT_PUBLIC_API_BASE_URL ?? "";
|
||||
|
||||
// POST /api/admin/beta-invites?dryRun=true&limit=10&tokenMinutes=30
|
||||
export async function POST(req: Request) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
const API_BASE_URL =
|
||||
process.env.NEXT_PUBLIC_API_BASE_URL ?? "http://localhost:8080";
|
||||
process.env.NEXT_PUBLIC_API_BASE_URL ?? "";
|
||||
|
||||
const TOS_VERSION = "2025-12-27";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
const API_BASE_URL =
|
||||
process.env.NEXT_PUBLIC_API_BASE_URL ?? "http://localhost:8080";
|
||||
process.env.NEXT_PUBLIC_API_BASE_URL ?? "";
|
||||
|
||||
export async function POST(req: Request) {
|
||||
const body = await req.text().catch(() => "");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
const API_BASE_URL =
|
||||
process.env.NEXT_PUBLIC_API_BASE_URL ?? "http://localhost:8080";
|
||||
process.env.NEXT_PUBLIC_API_BASE_URL ?? "";
|
||||
|
||||
function passthroughHeaders(req: Request) {
|
||||
const h = new Headers();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
const API_BASE_URL =
|
||||
process.env.NEXT_PUBLIC_API_BASE_URL ?? "http://localhost:8080";
|
||||
process.env.NEXT_PUBLIC_API_BASE_URL ?? "";
|
||||
|
||||
export async function GET(req: Request) {
|
||||
const url = new URL(req.url);
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import { springProxy } from "@/lib/springProxy";
|
||||
import type {
|
||||
MerchantAdminResponse,
|
||||
MerchantAdminUpdateRequest,
|
||||
} from "@/types/merchant-admin";
|
||||
|
||||
export async function PUT(
|
||||
req: Request,
|
||||
{ params }: { params: { id: string } }
|
||||
) {
|
||||
const body = (await req.json()) as MerchantAdminUpdateRequest;
|
||||
|
||||
return springProxy<MerchantAdminResponse, MerchantAdminUpdateRequest>(
|
||||
req,
|
||||
`/api/v1/admin/merchants/${params.id}`,
|
||||
{ method: "PUT", body }
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { springProxy } from "@/lib/springProxy";
|
||||
import type {
|
||||
MerchantAdminCreateRequest,
|
||||
MerchantAdminResponse,
|
||||
} from "@/types/merchant-admin";
|
||||
|
||||
export async function GET(req: Request) {
|
||||
return springProxy<MerchantAdminResponse[]>(req, "/api/v1/admin/merchants");
|
||||
}
|
||||
|
||||
export async function POST(req: Request) {
|
||||
const body = (await req.json()) as MerchantAdminCreateRequest;
|
||||
|
||||
return springProxy<MerchantAdminResponse, MerchantAdminCreateRequest>(
|
||||
req,
|
||||
"/api/v1/admin/merchants",
|
||||
{ method: "POST", body }
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user