From f6d9a9f71c1afafe80e70da167ecb800583a03ba Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Tue, 18 Oct 2022 22:27:50 +0200 Subject: [PATCH] refactoring of SideMenuWithCategories.vue --- src/SideMenuWithCategories.vue | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/SideMenuWithCategories.vue b/src/SideMenuWithCategories.vue index e4cad94..69c3d1b 100644 --- a/src/SideMenuWithCategories.vue +++ b/src/SideMenuWithCategories.vue @@ -79,17 +79,13 @@ export default { }, methods: { retrieveApps() { - this.apps = [] - let that = this - axios .get(OC.generateUrl('/apps/side_menu/nav/items')) - .then(function(response) { - that.items = response.data.items - + .then((response) => { + this.items = response.data.items let apps = [] - for (let category of that.items) { + for (let category of this.items) { for (let a in category.apps) { apps.push(category.apps[a]) } @@ -107,15 +103,13 @@ export default { }, retrieveConfig() { - let that = this - axios .get(OC.generateUrl('/apps/side_menu/js/config')) - .then(function(response) { + .then((response) => { const config = response.data - that.targetBlankApps = config['target-blank-apps'] - that.settings = config['settings'] + this.targetBlankApps = config['target-blank-apps'] + this.settings = config['settings'] }) }, },