Working API for subscribing and unsubscribing

This commit is contained in:
Andris Reinman 2016-05-07 14:28:24 +03:00
parent d5222f7b4d
commit 11f412ded1
15 changed files with 439 additions and 24 deletions

View file

@ -69,6 +69,10 @@ router.post('/update', passport.parseForm, passport.csrfProtection, (req, res) =
Object.keys(data).forEach(key => {
let value = data[key].trim();
key = tools.toDbKey(key);
// ensure trailing slash for service home page
if (key === 'service_url' && value && !/\/$/.test(value)) {
value = value + '/';
}
if (allowedKeys.indexOf(key) >= 0) {
keys.push(key);
values.push(value);