Bugs in settings fixed, profile added
This commit is contained in:
@@ -10,13 +10,30 @@ class ContactService {
|
||||
name = '';
|
||||
email = '';
|
||||
}
|
||||
ContactMessage.create({
|
||||
await ContactMessage.create({
|
||||
email,
|
||||
name,
|
||||
message,
|
||||
allowDataSave: acceptDataSave
|
||||
});
|
||||
}
|
||||
|
||||
async getContactById(id) {
|
||||
const contact = await ContactMessage.findByPk(id);
|
||||
if (!contact) {
|
||||
const error = new Error('Contact not found');
|
||||
error.status = 404;
|
||||
throw error;
|
||||
}
|
||||
return contact;
|
||||
}
|
||||
|
||||
async saveAnswer(contact, answer) {
|
||||
contact.answer = answer;
|
||||
contact.answeredAt = new Date();
|
||||
contact.isFinished = true;
|
||||
await contact.save();
|
||||
}
|
||||
}
|
||||
|
||||
export default new ContactService();
|
||||
export default new ContactService();
|
||||
|
||||
Reference in New Issue
Block a user