Fix CORS Issues and Add Contact Message Management#1
Merged
samarth3301 merged 4 commits intomainfrom Nov 7, 2025
Merged
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
Contributor
There was a problem hiding this comment.
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 <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
|
@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 <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes Made
Backend (brickChain-waitlist)
Technical Details