ac1cd96ecd
Test and Lint / backend-test (push) Successful in 1m16s
continuous-integration/drone/push Build is failing
Test and Lint / frontend-test (push) Successful in 2m18s
Version and Release / version-bump (push) Successful in 43s
Version and Release / trigger-drone (push) Successful in 4s
Major fixes for production deployment with Traefik: 1. API Path Fixes: - Remove double /api prefix from all frontend service calls - Fix auth.service.ts to use correct paths (/auth/admin/login) - Update all services to use single /api prefix from base URL - Fix template literal paths in photo services 2. Docker Configuration: - Add build args for VITE_API_URL in docker-compose.prod.yml - Create Dockerfile.prod with proper API URL configuration - Ensure frontend is built with correct API base path 3. Documentation: - Add comprehensive TRAEFIK_DEPLOYMENT.md guide - Document proper Traefik labels and routing configuration - Include troubleshooting steps for common issues - Explain network configuration and SSL handling This resolves: - 502 Bad Gateway errors - Double /api/api paths in requests - Frontend unable to communicate with backend - Login functionality not working The frontend now correctly calls the backend API through Traefik's routing, with all requests going to /api/* being forwarded to the backend service on port 3000. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
77 lines
2.1 KiB
TypeScript
77 lines
2.1 KiB
TypeScript
import { api } from '../config/api';
|
|
|
|
export interface EmailConfig {
|
|
smtp_host: string;
|
|
smtp_port: number;
|
|
smtp_secure: boolean;
|
|
smtp_user: string;
|
|
smtp_pass: string;
|
|
from_email: string;
|
|
from_name: string;
|
|
}
|
|
|
|
export interface EmailTemplate {
|
|
id: number;
|
|
template_key: string;
|
|
subject: string; // For backward compatibility
|
|
body_html: string; // For backward compatibility
|
|
body_text?: string; // For backward compatibility
|
|
subject_en: string;
|
|
subject_de: string;
|
|
body_html_en: string;
|
|
body_html_de: string;
|
|
body_text_en?: string;
|
|
body_text_de?: string;
|
|
variables: string[];
|
|
updated_at: string;
|
|
}
|
|
|
|
export interface EmailPreview {
|
|
subject: string;
|
|
body_html: string;
|
|
body_text: string;
|
|
}
|
|
|
|
export const emailService = {
|
|
// Get email configuration
|
|
async getConfig(): Promise<EmailConfig> {
|
|
const response = await api.get<EmailConfig>('/admin/email/config');
|
|
return response.data;
|
|
},
|
|
|
|
// Update email configuration
|
|
async updateConfig(config: EmailConfig): Promise<void> {
|
|
await api.post('/admin/email/config', config);
|
|
},
|
|
|
|
// Test email configuration
|
|
async testEmail(testEmail: string): Promise<void> {
|
|
await api.post('/admin/email/test', { test_email: testEmail });
|
|
},
|
|
|
|
// Get all email templates
|
|
async getTemplates(): Promise<EmailTemplate[]> {
|
|
const response = await api.get<EmailTemplate[]>('/admin/email/templates');
|
|
return response.data;
|
|
},
|
|
|
|
// Get single template
|
|
async getTemplate(key: string): Promise<EmailTemplate> {
|
|
const response = await api.get<EmailTemplate>(`/admin/email/templates/${key}`);
|
|
return response.data;
|
|
},
|
|
|
|
// Update email template
|
|
async updateTemplate(key: string, template: Partial<EmailTemplate>): Promise<void> {
|
|
await api.put(`/admin/email/templates/${key}`, template);
|
|
},
|
|
|
|
// Preview email template
|
|
async previewTemplate(key: string, previewData: Record<string, string>, language: 'en' | 'de' = 'en'): Promise<EmailPreview> {
|
|
const response = await api.post<EmailPreview>(
|
|
`/admin/email/templates/${key}/preview`,
|
|
{ preview_data: previewData, language }
|
|
);
|
|
return response.data;
|
|
}
|
|
}; |