Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/api/testimonials/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function POST(request: Request) {
const data = await request.json();

// Basic validation
if (!data.name || !data.role || !data.email || !data.content) {
if (!data.name || !data.role || !data.content || !data.cta) {
return NextResponse.json(
{ error: 'Missing required fields' },
{ status: 400 }
Expand Down
28 changes: 14 additions & 14 deletions components/submit-testimonial-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,10 @@ export function SubmitTestimonialModal() {
</div>

<div className="space-y-2">
<Label htmlFor="email">Email *</Label>
<Label htmlFor="email">Email (Optional)</Label>
<Input
id="email"
type="email"
required
value={formData.email}
onChange={(e) => setFormData({...formData, email: e.target.value})}
/>
Expand Down Expand Up @@ -202,6 +201,19 @@ export function SubmitTestimonialModal() {
/>
</div>

<div className="space-y-2">
<Label htmlFor="cta">Message to Readers *</Label>
<Input
id="cta"
type="text"
placeholder="Join Dev Weekends to level up your skills"
required
value={formData.cta}
onChange={(e) => setFormData({...formData, cta: e.target.value})}
/>
<p className="text-xs text-muted-foreground">Short call-to-action or closing thought.</p>
</div>

<div className="space-y-2">
<Label htmlFor="videoUrl">Video URL (Optional)</Label>
<Input
Expand All @@ -214,18 +226,6 @@ export function SubmitTestimonialModal() {
<p className="text-xs text-muted-foreground">Link to a YouTube video or similar.</p>
</div>

<div className="space-y-2">
<Label htmlFor="cta">CTA / Message to Readers (Optional)</Label>
<Input
id="cta"
type="text"
placeholder="Join Dev Weekends to level up your skills"
value={formData.cta}
onChange={(e) => setFormData({...formData, cta: e.target.value})}
/>
<p className="text-xs text-muted-foreground">Short call-to-action or closing thought.</p>
</div>

<DialogFooter>
<Button type="submit" disabled={loading} className="w-full">
{loading && <Loader2 className="w-4 h-4 mr-2 animate-spin" />}
Expand Down
1 change: 0 additions & 1 deletion models/Testimonial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const TestimonialSchema = new Schema<ITestimonial>(
},
email: {
type: String,
required: [true, 'Email is required'], // For internal contact/verification
trim: true,
},
content: {
Expand Down
Loading