- var type = Account['account-type'];
- var params = Account.params;
-
- if(params) {
- for (var i = 0; i < params.length; i++) {
- var param = params[i].ref;
- if (typeof(Account[type]) == 'undefined' || typeof(Account[type][param]) == 'undefined' || Account[type][param] == "") {
- if (!params[i].optional) {
- self.props.flux.actions.global.showNotification("Please fill all account details");
- return;
- }
- }
- }
- }
-
- let nestedParams = Account.nestedParams && Account.nestedParams;
- if (nestedParams && nestedParams.params) {
- for (let i = 0; i < nestedParams.params.length; i++) {
- let nestedParam = nestedParams.params[i].ref;
- if (typeof(Account[type]) == 'undefined' || typeof(Account[type][nestedParams['container-name']][nestedParam]) == 'undefined' || Account[type][nestedParams['container-name']][nestedParam] == "") {
- if (!nestedParams.params[i].optional) {
- self.props.flux.actions.global.showNotification("Please fill all account details");
- return;
- }
- }
- }
+ if(!wasAllDetailsFilled(Account)) {
+ self.props.flux.actions.global.showNotification("Please fill all account details");
+ return;