Skip to content

Conversation

@akshad-exe
Copy link
Contributor

Changes Made

Backend (brickChain-waitlist)

  • CORS Configuration: Updated CORS settings to properly handle ngrok origins and preflight OPTIONS requests
  • Authentication Middleware: Modified to skip authentication for CORS preflight requests
  • Contact Messages: Added status update functionality for contact form submissions
  • Database Config: Fixed environment variable validation issues

Technical Details

  • CORS now allows localhost and ngrok origins for development
  • Contact messages can be marked as UNREAD, READ, or REPLIED
  • Authentication middleware properly handles preflight requests
  • Database connection includes retry logic with exponential backoff

- Configure CORS to allow ngrok origins and handle preflight requests
- Update authentication middleware to skip OPTIONS requests
- Add contact message status update functionality
- Fix database configuration validation
@akshad-exe akshad-exe requested a review from Copilot November 6, 2025 14:20
@akshad-exe akshad-exe self-assigned this Nov 6, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds functionality to update contact form statuses and improves database connection handling with retry logic. The changes introduce a new API endpoint for admin users to manage contact form responses and enhance the application's resilience to transient database connection issues.

  • Added updateContactStatus endpoint with validation and status management for contact forms
  • Implemented database connection retry logic with exponential backoff
  • Enhanced CORS configuration with explicit origin validation for development and production environments

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/routes/v1/admin/routes.ts Adds PUT endpoint for updating contact form status
src/middlewares/auth.middleware.ts Bypasses authentication for OPTIONS preflight requests
src/controllers/v1/admin/contactForm/contactForms.controller.ts Implements updateContactStatus controller with validation and adds ordering to getAllContactForms
src/config/envVars.ts Adds DATABASE_URL to environment variable validation
src/config/database.ts Implements connection retry logic with exponential backoff and connection status tracking
src/app.ts Replaces default CORS with custom configuration for origin validation and preflight handling
prisma/schema.prisma Adds ContactStatus enum and status field to ContactUs model with UNREAD default

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI commented Nov 7, 2025

@samarth3301 I've opened a new pull request, #2, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: Copilot <[email protected]>
@samarth3301 samarth3301 merged commit 5c6c9f9 into main Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants