Subscriptions with the same URL can now be added as long as the new subscription is named

pull/195/head
Isaac Abadi 5 years ago
parent 945ba268fb
commit 52bee8b280

@ -40,9 +40,9 @@ async function subscribe(sub, user_uid = null) {
else else
url_exists = !!db.get('subscriptions').find({url: sub.url}).value(); url_exists = !!db.get('subscriptions').find({url: sub.url}).value();
if (url_exists) { if (!sub.name && url_exists) {
logger.info('Sub already exists'); logger.error(`Sub with the same URL already exists -- please provide a custom name for this new subscription.`);
result_obj.error = 'Subcription with URL ' + sub.url + ' already exists!'; result_obj.error = 'Subcription with URL ' + sub.url + ' already exists! Custom name is required.';
resolve(result_obj); resolve(result_obj);
return; return;
} }

Loading…
Cancel
Save