added sender ID to the clients Tab in Show view plus bug fixes

This commit is contained in:
Kwesi Banson
2024-08-26 10:23:49 +00:00
parent 4a0248e40d
commit 6cede6d980
54 changed files with 1948 additions and 120 deletions

View File

@@ -66,6 +66,11 @@
$('#shortCodeType').val('voice');
$('#newShortCodeFormModal').modal('show');
});
$('#createSenderIdBtn').click(function(evt){
evt.preventDefault();
console.log('Heere at the wall');
$('#newSenderIdFormModal').modal('show');
});
$('#createPaymentBtn').click(function(evt){
evt.preventDefault();
@@ -264,7 +269,7 @@
location.reload();
}, 8000);
}
else if (data.code > 5) {
else if (data.code > 1) {
$.alert({
title: 'Alert!',
content: data.msg,
@@ -343,7 +348,7 @@
});
});
/*
$('#financeServicesStore').change(function(evtt){
let currentServices = $('#financeServicesStore').val();
$.each(currentServices, function (key, value) {
@@ -359,6 +364,7 @@
}
});
});
*/
$('#financeEditForm').submit(function(evt){
evt.preventDefault();
@@ -521,4 +527,52 @@
});
});
$('#newSenderIdForm').submit(function(evt){
evt.preventDefault();
var formData = new FormData($(this)[0]);
$.ajax({
type: "POST",
url: base_url + '/senderids/direct_store',
data : formData,
processData: false,
contentType: false,
async: false,
success: function (data){
if (data.code === 1) {
$.alert({
title: 'Alert!',
content: 'Sender ID successfully saved',
});
setTimeout(function(){
location.reload();
}, 8000);
}
else if (data.code > 1) {
$.alert({
title: 'Alert!',
content: data.msg,
});
}
else {
$.alert({
title: 'Alert!',
content: 'Your request could not be handled. Try again !',
});
}
},
error: function (data) {
var output = $.parseJSON(data.responseText);
console.log(output.errors);
$('#senderIdnotifyArea').removeClass('hidden');
$.each(output.errors, function (key, value) {
console.log(value[0]);
$('#senderIdnotifyArea').text(value[0]);
});
},
fail : function(errordata){
console.log(errordata);
}
});
});
});