Bugs in settings fixed, profile added
This commit is contained in:
@@ -5,6 +5,8 @@ import InterestTranslationType from "../models/type/interest_translation.js"
|
||||
import User from "../models/community/user.js";
|
||||
import UserParamValue from "../models/type/user_param_value.js";
|
||||
import ContactMessage from "../models/service/contactmessage.js";
|
||||
import ContactService from "./ContactService.js";
|
||||
import { sendAnswerEmail } from './emailService.js';
|
||||
|
||||
class AdminService {
|
||||
async hasUserAccess(userId, section) {
|
||||
@@ -18,7 +20,7 @@ class AdminService {
|
||||
},
|
||||
{
|
||||
model: User,
|
||||
as: 'user',
|
||||
as: 'user_with_rights',
|
||||
where: {
|
||||
hashedId: userId,
|
||||
}
|
||||
@@ -129,6 +131,13 @@ class AdminService {
|
||||
})
|
||||
return openContacts;
|
||||
}
|
||||
|
||||
async answerContact(contactId, answer) {
|
||||
const contact = await ContactService.getContactById(contactId);
|
||||
await ContactService.saveAnswer(contact, answer);
|
||||
await sendAnswerEmail(contact.email, answer, contact.language || 'en');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default new AdminService();
|
||||
Reference in New Issue
Block a user