Fix category not load

This commit is contained in:
2023-09-14 17:17:54 +07:00
parent f9745d357f
commit 46e0f3d2d2
2 changed files with 5 additions and 4 deletions
@@ -32,6 +32,7 @@ export default class HomeController {
if (this.homeView) { if (this.homeView) {
this.homeView.addHandlerEventWalletForm( this.homeView.addHandlerEventWalletForm(
this.handlerSaveWallet.bind(this), this.handlerSaveWallet.bind(this),
this.handlerGetAllCategory.bind(this),
); );
this.homeView.loadPage( this.homeView.loadPage(
+4 -4
View File
@@ -298,11 +298,11 @@ export default class HomeView extends CommonView {
// ---------------------END DIALOG---------------------// // ---------------------END DIALOG---------------------//
// ---------------------WALLET DIALOG--------------------- // // ---------------------WALLET DIALOG--------------------- //
addHandlerEventWalletForm(saveWallet) { addHandlerEventWalletForm(saveWallet, getAllCategory) {
this.walletDialog.addEventListener('submit', (e) => { this.walletDialog.addEventListener('submit', (e) => {
e.preventDefault(); e.preventDefault();
this.submitWalletForm(saveWallet); this.submitWalletForm(saveWallet, getAllCategory);
}); });
this.walletDialog.addEventListener('input', (e) => { this.walletDialog.addEventListener('input', (e) => {
@@ -311,7 +311,7 @@ export default class HomeView extends CommonView {
}); });
} }
async submitWalletForm(saveWallet) { async submitWalletForm(saveWallet, getAllCategory) {
this.walletDialog.close(); this.walletDialog.close();
this.toggleLoaderSpinner(); this.toggleLoaderSpinner();
@@ -335,7 +335,7 @@ export default class HomeView extends CommonView {
); );
this.loadEvent(); // Load event page this.loadEvent(); // Load event page
this.loadData(); // Load data from database into page this.loadData(getAllCategory); // Load data from database into page
} catch (error) { } catch (error) {
// Show toast error // Show toast error
this.showErrorToast(error); this.showErrorToast(error);