Notification service #35

Merged
bilal.catic merged 26 commits from notification-service into master 2019-09-30 16:23:40 +02:00
Showing only changes of commit 87a72be8fe - Show all commits

View File

@@ -1,6 +1,8 @@
const { currentSearchRequest } = require("../helpers/url");
const { isValidEmail } = require("../helpers/email");
const { sendTemplatedEmail } = require("../helpers/awsEmail");
const {
notifyForNewSearchRequest
} = require("../services/notificationService");
const getQuerySubmit = async (req, res) => {
const title = "Upišite vaš e-mail";
@@ -42,7 +44,8 @@ const postQuerySubmit = async (req, res) => {
searchRequest.subscribed = true;
await searchRequest.save();
sendTemplatedEmail(emailInput, searchRequest);
await notifyForNewSearchRequest(searchRequest);
res.redirect(nextStep);
};