connect js function moved to global
This commit is contained in:
		
							
								
								
									
										37
									
								
								resources/assets/js/mixins/global.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										37
									
								
								resources/assets/js/mixins/global.js
									
									
									
									
										vendored
									
									
								
							| @@ -85,7 +85,12 @@ export default { | ||||
|                 "thousands_separator":",", | ||||
|             }, | ||||
|             all_currencies: [], | ||||
|             content_loading: true | ||||
|             content_loading: true, | ||||
|             connect: { | ||||
|                 show: false, | ||||
|                 currency: {}, | ||||
|                 documents: [], | ||||
|             }, | ||||
|         } | ||||
|     }, | ||||
|  | ||||
| @@ -656,6 +661,34 @@ export default { | ||||
|                 copy_badge.classList.remove('flex'); | ||||
|                 copy_html.classList.remove('hidden'); | ||||
|             }, 800); | ||||
|         } | ||||
|         }, | ||||
|  | ||||
|         //connect transactions for account, document or etc. | ||||
|         onConnectTransactions(route) { | ||||
|             let dial_promise = Promise.resolve(window.axios.get(route)); | ||||
|  | ||||
|             dial_promise.then(response => { | ||||
|                 this.connect.show = true; | ||||
|  | ||||
|                 this.connect.transaction = JSON.parse(response.data.transaction); | ||||
|  | ||||
|                 let currency = JSON.parse(response.data.currency); | ||||
|  | ||||
|                 this.connect.currency = { | ||||
|                     decimal_mark: currency.decimal_mark, | ||||
|                     precision: currency.precision, | ||||
|                     symbol: currency.symbol, | ||||
|                     symbol_first: currency.symbol_first, | ||||
|                     thousands_separator: currency.thousands_separator, | ||||
|                 }; | ||||
|      | ||||
|                 this.connect.documents = JSON.parse(response.data.documents); | ||||
|             }) | ||||
|             .catch(error => { | ||||
|             }) | ||||
|             .finally(function () { | ||||
|                 // always executed | ||||
|             }); | ||||
|         }, | ||||
|     } | ||||
| } | ||||
|   | ||||
							
								
								
									
										32
									
								
								resources/assets/js/views/banking/accounts.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										32
									
								
								resources/assets/js/views/banking/accounts.js
									
									
									
									
										vendored
									
									
								
							| @@ -29,11 +29,6 @@ const app = new Vue({ | ||||
|         return { | ||||
|             form: new Form('account'), | ||||
|             bulk_action: new BulkAction('accounts'), | ||||
|             connect: { | ||||
|                 show: false, | ||||
|                 currency: {}, | ||||
|                 documents: [], | ||||
|             }, | ||||
|         } | ||||
|     }, | ||||
|  | ||||
| @@ -60,32 +55,5 @@ const app = new Vue({ | ||||
|         onBank() { | ||||
|  | ||||
|         }, | ||||
|  | ||||
|         onConnect(route) { | ||||
|             let dial_promise = Promise.resolve(window.axios.get(route)); | ||||
|  | ||||
|             dial_promise.then(response => { | ||||
|                 this.connect.show = true; | ||||
|  | ||||
|                 this.connect.transaction = JSON.parse(response.data.transaction); | ||||
|  | ||||
|                 let currency = JSON.parse(response.data.currency); | ||||
|  | ||||
|                 this.connect.currency = { | ||||
|                     decimal_mark: currency.decimal_mark, | ||||
|                     precision: currency.precision, | ||||
|                     symbol: currency.symbol, | ||||
|                     symbol_first: currency.symbol_first, | ||||
|                     thousands_separator: currency.thousands_separator, | ||||
|                 }; | ||||
|      | ||||
|                 this.connect.documents = JSON.parse(response.data.documents); | ||||
|             }) | ||||
|             .catch(error => { | ||||
|             }) | ||||
|             .finally(function () { | ||||
|                 // always executed | ||||
|             }); | ||||
|         }, | ||||
|     } | ||||
| }); | ||||
|   | ||||
| @@ -29,42 +29,10 @@ const app = new Vue({ | ||||
|         return { | ||||
|             form: new Form('transaction'), | ||||
|             bulk_action: new BulkAction('transactions'), | ||||
|             connect: { | ||||
|                 show: false, | ||||
|                 currency: {}, | ||||
|                 documents: [], | ||||
|             }, | ||||
|         } | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
|         onConnect(route) { | ||||
|             let dial_promise = Promise.resolve(window.axios.get(route)); | ||||
|  | ||||
|             dial_promise.then(response => { | ||||
|                 this.connect.show = true; | ||||
|  | ||||
|                 this.connect.transaction = JSON.parse(response.data.transaction); | ||||
|  | ||||
|                 let currency = JSON.parse(response.data.currency); | ||||
|  | ||||
|                 this.connect.currency = { | ||||
|                     decimal_mark: currency.decimal_mark, | ||||
|                     precision: currency.precision, | ||||
|                     symbol: currency.symbol, | ||||
|                     symbol_first: currency.symbol_first, | ||||
|                     thousands_separator: currency.thousands_separator, | ||||
|                 }; | ||||
|      | ||||
|                 this.connect.documents = JSON.parse(response.data.documents); | ||||
|             }) | ||||
|             .catch(error => { | ||||
|             }) | ||||
|             .finally(function () { | ||||
|                 // always executed | ||||
|             }); | ||||
|         }, | ||||
|  | ||||
|         async onEmail(route) { | ||||
|             let email = { | ||||
|                 modal: false, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user