From 3df876c202b21914dd98ff5a058fc67898a68bd3 Mon Sep 17 00:00:00 2001 From: Buhle Date: Mon, 16 Oct 2023 08:59:16 +0200 Subject: [PATCH] removed repeated code --- go-app-ussd_tb_check.js | 47 ----------------------------------------- 1 file changed, 47 deletions(-) diff --git a/go-app-ussd_tb_check.js b/go-app-ussd_tb_check.js index 936b81bf..44e9101f 100644 --- a/go-app-ussd_tb_check.js +++ b/go-app-ussd_tb_check.js @@ -1,53 +1,6 @@ var go = {}; go; -go.Engage = function() { - var vumigo = require('vumigo_v02'); - var events = vumigo.events; - var Eventable = events.Eventable; - var _ = require('lodash'); - var url = require('url'); - - var Engage = Eventable.extend(function(self, json_api, base_url, token) { - self.json_api = json_api; - self.base_url = base_url; - self.json_api.defaults.headers.Authorization = ['Bearer ' + token]; - self.json_api.defaults.headers['Content-Type'] = ['application/json']; - - self.contact_check = function(msisdn, block) { - return self.json_api.post(url.resolve(self.base_url, 'v1/contacts'), { - data: { - blocking: block ? 'wait' : 'no_wait', - contacts: [msisdn] - } - }).then(function(response) { - var existing = _.filter(response.data.contacts, function(obj) { - return obj.status === "valid"; - }); - return !_.isEmpty(existing); - }); - }; - - self.LANG_MAP = {zul_ZA: "en", - xho_ZA: "en", - afr_ZA: "af", - eng_ZA: "en", - nso_ZA: "en", - tsn_ZA: "en", - sot_ZA: "en", - tso_ZA: "en", - ssw_ZA: "en", - ven_ZA: "en", - nbl_ZA: "en", - set_ZA: "en", - }; - }); - - - - return Engage; -}(); - go.RapidPro = function() { var vumigo = require('vumigo_v02'); var url_utils = require('url');