Add password reset localization and chat configuration
- Implemented German and English localization for password reset functionality. - Added WebSocket URL resolution logic in chat services to support various environments and configurations. - Created centralized chat configuration for event keys and payload mappings. - Developed RoomsView component for admin chat room management, including create, edit, and delete functionalities.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import ContactService from '../services/ContactService.js';
|
||||
import Joi from 'joi';
|
||||
|
||||
class ContactController {
|
||||
constructor() {
|
||||
@@ -6,9 +7,18 @@ class ContactController {
|
||||
}
|
||||
|
||||
async addContactMessage(req, res) {
|
||||
const schema = Joi.object({
|
||||
email: Joi.string().email().required(),
|
||||
name: Joi.string().min(1).max(255).required(),
|
||||
message: Joi.string().min(1).max(2000).required(),
|
||||
acceptDataSave: Joi.boolean().required()
|
||||
});
|
||||
const { error, value } = schema.validate(req.body);
|
||||
if (error) {
|
||||
return res.status(400).json({ error: error.details[0].message });
|
||||
}
|
||||
try {
|
||||
const { email, name, message, acceptDataSave } = req.body;
|
||||
await ContactService.addContactMessage(email, name, message, acceptDataSave);
|
||||
await ContactService.addContactMessage(value.email, value.name, value.message, value.acceptDataSave);
|
||||
res.status(200).json({ status: 'ok' });
|
||||
} catch (error) {
|
||||
res.status(409).json({ error: error.message });
|
||||
|
||||
Reference in New Issue
Block a user