Conversation
…platform into bsl-30-applypageui
| body: JSON.stringify({ | ||
| StartupName : form.name, | ||
| StartupDescription : form.description, | ||
| StartupFundingGoal : form.fundingGoal, | ||
| StartupContact : form.contact, | ||
| }), |
There was a problem hiding this comment.
Make startup contact as:
StartupContact: {
email: form.contact,
name: form.name,
},
StartupContact is sent as a plain string but the API derives submitterEmail as StartupContact?.email
So send StartupContact as an object (email: form.contact, form: form.name} so the API can correctly populate subitterEmail and submitterName
| body: JSON.stringify({ | ||
| StartupName : form.name, | ||
| StartupDescription : form.description, | ||
| StartupFundingGoal : form.fundingGoal, | ||
| StartupContact : form.contact, | ||
| }), |
There was a problem hiding this comment.
Also the form has 6 fields including deckURL and fundingSiteURL
but it is never included in the request body and seem to just be silently dropped.
So add StartupDeckUrl: form.deckUrl and StartupFundingSiteUrl: form.fundingSiteUrl to the payload
| </div> | ||
|
|
||
| <div className="flex justify-center pt-4"> | ||
| <Button type="submit">Apply</Button> |
There was a problem hiding this comment.
You are tracking status but not really using it I believe. The user should get some sort of visual feedback after submitting (like a success or error message).
So add a conditional render for status == "success" (green) or status == "error" (red)
AI generated this for inspiration:
{status === "success" && (
<p className="text-green-600 text-sm text-center">
Application submitted successfully!
</p>
)}
{status === "error" && (
<p className="text-red-600 text-sm text-center">
Something went wrong. Please try again.
</p>
)}
| </div> | ||
|
|
||
| <div className="flex justify-center pt-4"> | ||
| <Button type="submit">Apply</Button> |
There was a problem hiding this comment.
you also track loading, but you should apply it to Button so that the submit button does NOT stay clickable throughout the request (which would allow u to submit multiple times).
So you can make it something like this:
<Button type="submit" disabled={loading}>
{loading ? "Submitting..." : "Apply"}
</Button>
| setForm({ | ||
| name: "", | ||
| description: "", | ||
| fundingGoal: "", | ||
| contact: "", |
There was a problem hiding this comment.
add deckUrl and fundingSiteUrl if we are adding this as inputs as I mentioned above
| </section> | ||
| <div className="relative z-10 flex flex-col sm:flex-row gap-6 mt-10 w-full max-w-4xl justify-center"> | ||
| {cards.map((card) => ( | ||
| <a |
There was a problem hiding this comment.
use from next/link instead of <a> for internal routes. Raw <a> tags trigger a full page reload and skip client-side routing and prefetching.
| const cards = [ | ||
| { id: "startup", label: "STARTUP\nAPPLICATION", href: "/apply/startup" }, | ||
| { id: "org", label: "ORG/COMPANY\nPROJECT FORM", href: "/apply/org" }, | ||
| { id: "student", label: "STUDENT/PRODUCT\nTEAM SKILLS FORM [Mock for now]", href: "#" }, |
There was a problem hiding this comment.
remove [Mock for now] and add the href to /apply/team
| <a | ||
| href={link.href} | ||
| className="text-black no-underline text-lg border-b-2 border-transparent hover:border-black transition-colors duration-200" | ||
| ></a> |
There was a problem hiding this comment.
Does anything show up here? I think you need a {link.label}
like:
<a
href={link.href}
className="text-black no-underline text-lg ..."
>{link.label}</a>
| @@ -1,3 +1,5 @@ | |||
| 'use client'; | |||
There was a problem hiding this comment.
I believe you can remove 'use client' here ..
| }} | ||
| > | ||
| <Image | ||
| <img |
There was a problem hiding this comment.
You should use Image from next/Image .. it provides better optimizations .. it looks like you use to use it but it got removed? is there a reason for that? or did I mess up something in the merge conflict resolutions?
No description provided.