diff options
Diffstat (limited to 'server/controllers/message.js')
-rw-r--r-- | server/controllers/message.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/server/controllers/message.js b/server/controllers/message.js index 37de7d2..8061c7a 100644 --- a/server/controllers/message.js +++ b/server/controllers/message.js @@ -26,4 +26,15 @@ const sendMessage = async (req, res) => { } }; -export default {sendOTP, sendMessage}; +const sendMessages = async (req, res) => { + const {mobile, message} = req.body; + + try { + sendSMS(mobile, message); + res.status(200).json({message: 'Message sent successfully'}); + } catch (error) { + res.status(404).json({message: error}); + } +}; + +export default {sendOTP, sendMessage, sendMessages}; |