this is my code = ```import { NextRequest, NextResponse } from "next/server";
import { useScaffoldContractWrite } from "~~/hooks/scaffold-eth";
export default async function POST(req: NextRequest) {
try {
console.log("Inside registerAdmin route");
const reqBody = await req.json();
const { accountAddress, emailId, password } = reqBody;
console.log(reqBody: ${JSON.stringify(reqBody)});
console.log(accountAddress: ${accountAddress});
console.log("Reading the contract");
const registerAdmin = useScaffoldContractWrite({
contractName: "YourContract",
functionName: "registerAdmin",
args: [emailId, password, accountAddress],
});
console.log("await registerAdmin.writeAsync()");
await registerAdmin.writeAsync();
return NextResponse.json({
message: "Admin registered successfully",
success: true,
});
} catch (err: any) {
// return the error message as a json object, and set the status code to 500
console.log(Error in signup route: ${err.message});
return NextResponse.json({ error: err.message }, { status: 500 });
}
}
whenever I try to register I get the error =Inside registerAdmin route
Error in signup route: req.json is not a function
error - TypeError: Response.json is not a function
at Function.json (/media/vivekup3424/New Volume/IIITM Gwalior/Sem 4/summer_project/Degchain-Frontend/packages/nextjs/node_modules/next/dist/server/web/spec-extension/response.js:61:35)
at POST (webpack-internal:///(api)/./pages/api/admin/register.ts:39:70)
at Object.apiResolver (/media/vivekup3424/New Volume/IIITM Gwalior/Sem 4/summer_project/Degchain-Frontend/packages/nextjs/node_modules/next/dist/server/api-utils/node.js:372:15)
at runMicrotasks (<anonymous>)this is my package.json ="mongodb": "^5.7.0",
"mongoose": "^7.3.4",
"next": "^13.1.6",
"nextjs-progressbar": "^0.0.16",
"react": "^18.2.0",
"react-blockies": "^1.4.1",```