Bugs in settings fixed, profile added

This commit is contained in:
Torsten Schulz
2024-09-21 00:25:42 +02:00
parent c5a72d57d8
commit e494fe41db
65 changed files with 3121 additions and 7478 deletions

View File

@@ -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();