@@ -1,18 +0,0 @@
|
||||
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 }
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
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