Added notification for new ad pusblish and new real estate.
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
const { findRealEstateByAgencyId } = require("../helpers/db/realEstate");
|
||||
const { bulkUpsertKiviPhotos } = require("../helpers/db/kiviOriginalAdsPhotos");
|
||||
const { currentKiviRealEstate } = require("../helpers/url");
|
||||
|
||||
const {
|
||||
notifyForNewRealEstates,
|
||||
notifyForNewAdPublish
|
||||
} = require("../services/notificationService");
|
||||
const validate = require("validate.js");
|
||||
|
||||
const {
|
||||
@@ -318,6 +321,11 @@ const postPublishInputs = async (req, res) => {
|
||||
|
||||
await kiviOriginal.save();
|
||||
|
||||
//Calling function to notify real estate owner that ads is published on Kivi page after 1 sec
|
||||
setTimeout(notifyForNewAdPublish, 1000, realEstate, kiviOriginal);
|
||||
//Calling function to notify users of new real estate after 2 min
|
||||
setTimeout(notifyForNewRealEstates, 1000 * 60 * 2, [realEstate]);
|
||||
|
||||
res.redirect(nextStepPage);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user