From b4f6c767c7349c6d15ae7c199910b619641d6a09 Mon Sep 17 00:00:00 2001 From: cheetah Date: Thu, 1 Dec 2022 14:29:20 +0100 Subject: [PATCH] fixed url backward compat --- index.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 8dd71a0..91ce564 100644 --- a/index.js +++ b/index.js @@ -65,10 +65,15 @@ for (let deliveryModeIndex in config.deliveryModes) { const deliveryModeData = config.deliveryModes[ deliveryModeIndex ] let msgId = ( - await axios.post(new URL(config.pager.url).origin + '/api/message/' + (!!deliveryModeData.preset ? 'preset' : 'advanced'), Object.assign( !!deliveryModeData.preset - ? { ...deliveryModeData.params } // backward compatibility - : { preset: deliveryModeData.preset } - , { payload: origText })) + await axios.post( + new URL(config.pager.url).origin + '/api/message/' + (!!deliveryModeData.preset ? 'preset' : 'advanced'), + Object.assign( !!deliveryModeData.preset + ? { preset: deliveryModeData.preset } // backward compatibility + : { ...deliveryModeData.params } + , { + payload: origText + }) + ) ).data assoc[msgId] = { date: new Date(),