From 52bee8b280fe6df5ead1b164106f9b235dea5f42 Mon Sep 17 00:00:00 2001 From: Isaac Abadi Date: Thu, 13 Aug 2020 18:34:30 -0400 Subject: [PATCH] Subscriptions with the same URL can now be added as long as the new subscription is named --- backend/subscriptions.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/subscriptions.js b/backend/subscriptions.js index ce5d1a6..097eb50 100644 --- a/backend/subscriptions.js +++ b/backend/subscriptions.js @@ -40,9 +40,9 @@ async function subscribe(sub, user_uid = null) { else url_exists = !!db.get('subscriptions').find({url: sub.url}).value(); - if (url_exists) { - logger.info('Sub already exists'); - result_obj.error = 'Subcription with URL ' + sub.url + ' already exists!'; + if (!sub.name && url_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! Custom name is required.'; resolve(result_obj); return; }