Skip to content

Commit

Permalink
Merge pull request #4 from tuyennn/feature/refactoring-js
Browse files Browse the repository at this point in the history
[feat] Refactoring javascript
  • Loading branch information
tuyennn authored Oct 24, 2024
2 parents da65e90 + deb5508 commit 13586be
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
1 change: 0 additions & 1 deletion view/base/web/js/view/payment/kbankjs-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ define([
'jquery',
'uiClass',
'GhoSter_KbankPayments/js/view/payment/validator-handler'
//phpcs:ignore Squiz.Functions.MultiLineFunctionDeclaration.SpaceBeforeOpenParen
], function (
$,
Class,
Expand Down
18 changes: 10 additions & 8 deletions view/frontend/web/js/model/installment.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ define([
], function (ko, _) {
'use strict';

var proceedInstallmentData = function (data) {
let installmentData = {};
if (_.isObject(data)) {
installmentData['payment_term'] = data.hasOwnProperty('payment_term') ? data.payment_term : null;
installmentData['smartpay_id'] = data.hasOwnProperty('smartpay_id') ? data.smartpay_id : null;
installmentData['installment_title'] = data.hasOwnProperty('installment_title') ? data.installment_title : null;
}
return installmentData;
const proceedInstallmentData = function (data) {
let installmentData = {};

if (_.isObject(data)) {
installmentData['payment_term'] = data.hasOwnProperty('payment_term') ? data.payment_term : null;
installmentData['smartpay_id'] = data.hasOwnProperty('smartpay_id') ? data.smartpay_id : null;
installmentData['installment_title'] = data.hasOwnProperty('installment_title')
? data.installment_title : null;
}
return installmentData;
},
installmentData = proceedInstallmentData(window.checkoutConfig.quoteData),
installmentInformation = ko.observable(installmentData),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ define([

if (installmentInformation) {
isSelected = installmentInformation.smartpay_id == this.installment().smartpay_id &&
// eslint-disable-next-line max-len
installmentInformation.payment_term == this.installment().payment_term; //eslint-disable-line eqeqeq
}

Expand Down

0 comments on commit 13586be

Please sign in to comment.