adapt unsubscribe step for new DB design

This commit is contained in:
Bilal Catic
2019-09-13 14:54:21 +02:00
parent 2b22cd04fd
commit 5dfe363adc

View File

@@ -1,10 +1,10 @@
const { currentRERequest } = require("../helpers/url"); const { currentSearchRequest } = require("../helpers/url");
const getUnsubscribe = async (req, res) => { const getUnsubscribe = async (req, res) => {
const title = "Uspješno ste se odjavili"; const title = "Uspješno ste se odjavili";
const request = await currentRERequest(req); const searchRequest = await currentSearchRequest(req);
request.subscribed = false; searchRequest.subscribed = false;
await request.save(); await searchRequest.save();
res.render("unsubscribe", { nextStep: "/vrstanekretnine", title }); res.render("unsubscribe", { nextStep: "/vrstanekretnine", title });
}; };