| 123456789101112131415161718192021222324252627282930313233343536 |
- import { NextResponse, NextRequest } from "next/server";
- import { restApiFetch } from "@/utils/bagisto";
- // http://nshop.test/api/customer/check-email?email=bb@tt.com
- export async function GET(request: NextRequest) {
- try {
- const searchParams = request.nextUrl.searchParams;
- const email = searchParams.get('email');
- const response = await restApiFetch<any>({
- api: "/customer/check-email",
- method: "GET",
- cache: "no-store",
- variables: {
- email: email
- }
- });
- return NextResponse.json(
- response.body,
- {status: response.status}
- );
- } catch (error) {
- return NextResponse.json(
- {
- message: "Network error",
- error: error instanceof Error ? error.message : error,
- },
- { status: 500 }
- );
- }
- }
|