From 1b2f0746bf5debc78c51880e0ade5792be624efa Mon Sep 17 00:00:00 2001 From: Shiv Bhonde Date: Thu, 14 Mar 2024 11:47:31 +0000 Subject: [PATCH] remove select askAmount --- packages/nextjs/app/api/grants/new/route.ts | 5 +++++ packages/nextjs/app/apply/_component/Form.tsx | 15 +-------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/packages/nextjs/app/api/grants/new/route.ts b/packages/nextjs/app/api/grants/new/route.ts index 1a80c8b..31dbb8c 100644 --- a/packages/nextjs/app/api/grants/new/route.ts +++ b/packages/nextjs/app/api/grants/new/route.ts @@ -21,6 +21,11 @@ export async function POST(req: Request) { return NextResponse.json({ error: "Invalid form details submited" }, { status: 400 }); } + // Check to see if the askAmount === 0.25 + if (Number(askAmount) !== 0.25) { + return NextResponse.json({ error: "Invalid askAmount" }, { status: 400 }); + } + // Verif if the builder is present const builder = await findUserByAddress(signer); if (!builder.exists) { diff --git a/packages/nextjs/app/apply/_component/Form.tsx b/packages/nextjs/app/apply/_component/Form.tsx index 07bd057..b91bde0 100644 --- a/packages/nextjs/app/apply/_component/Form.tsx +++ b/packages/nextjs/app/apply/_component/Form.tsx @@ -17,8 +17,6 @@ type ReqBody = { signer?: string; }; -const selectOptions = [0.1, 0.25, 0.5, 1]; - const Form = () => { const { address: connectedAddress } = useAccount(); const { signTypedDataAsync } = useSignTypedData(); @@ -34,7 +32,7 @@ const Form = () => { try { const title = formData.get("title") as string; const description = formData.get("description") as string; - const askAmount = formData.get("askAmount") as string; + const askAmount = "0.25"; if (!title || !description || !askAmount) { notification.error("Please fill all the fields"); return; @@ -91,17 +89,6 @@ const Form = () => { /> -
-

Ask amount

- -