refactor: update application code to use unified configuration
- Update App.tsx to use getAppConfig() instead of import.meta.env - Update email templates to use getAppConfig() for base URL - Update database strategy to use getDatabaseConfig() function - Update mailgun service to use getter functions - Remove direct unified config imports in favor of functions - Ensure consistent configuration access throughout codebase
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
} from '../../types';
|
||||
import { AccountStatus } from '../auth/auth.constants';
|
||||
import { DatabaseStrategy, DatabaseError } from './types';
|
||||
import { databaseConfig } from '../../config/unified.config';
|
||||
import { getDatabaseConfig } from '../../config/unified.config';
|
||||
import { logger } from '../logging';
|
||||
|
||||
export class ProductionDatabaseStrategy implements DatabaseStrategy {
|
||||
@@ -19,7 +19,7 @@ export class ProductionDatabaseStrategy implements DatabaseStrategy {
|
||||
|
||||
constructor() {
|
||||
// Get CouchDB configuration from unified config
|
||||
const dbConfig = databaseConfig;
|
||||
const dbConfig = getDatabaseConfig();
|
||||
|
||||
this.baseUrl = dbConfig.url;
|
||||
this.auth = btoa(`${dbConfig.username}:${dbConfig.password}`);
|
||||
@@ -28,9 +28,6 @@ export class ProductionDatabaseStrategy implements DatabaseStrategy {
|
||||
url: dbConfig.url,
|
||||
username: dbConfig.username,
|
||||
});
|
||||
|
||||
// Initialize databases
|
||||
this.initializeDatabases();
|
||||
}
|
||||
|
||||
private async initializeDatabases(): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user