-
Notifications
You must be signed in to change notification settings - Fork 0
Fix CORS Issues and Add Contact Message Management #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- 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
There was a problem hiding this 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
updateContactStatusendpoint 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.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
@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]>
Changes Made
Backend (brickChain-waitlist)
Technical Details