From 670b581699cf07cd752710237662765c530e8717 Mon Sep 17 00:00:00 2001 From: Mauricio Astudillo Toledo Date: Fri, 29 Nov 2024 16:58:33 -0300 Subject: [PATCH] fix: reduce nested callbacks --- plugin/js/admin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/js/admin.js b/plugin/js/admin.js index 3458c7d..06dc6cb 100644 --- a/plugin/js/admin.js +++ b/plugin/js/admin.js @@ -99,11 +99,11 @@ jQuery(function($) { const fieldValue = document.createElement('span'); fieldValue.className = 'tbk-field-value'; - fieldValue.textContent = value.toString(); + fieldValue.textContent = value; if(key == 'status') { fieldValue.classList.add('tbk-badge'); - fieldValue.classList.add(getBadgeColorFromStatus(value.toString())); + fieldValue.classList.add(getBadgeColorFromStatus(value)); } if(key == 'cardNumber') { @@ -139,7 +139,7 @@ jQuery(function($) { 'Reversada': 'tbk-badge-info', 'Parcialmente anulada': 'tbk-badge-info' }; - + return statusColorsDictionary[status] ?? 'tbk-badge-default'; }