From 8221184af73f7eab810be7f63bd8bc3723f05280 Mon Sep 17 00:00:00 2001 From: Talisson Ferreira Date: Tue, 12 Nov 2019 12:07:49 -0300 Subject: [PATCH] feat(application): delete application --- src/views/Applications/Application.vue | 27 +++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/views/Applications/Application.vue b/src/views/Applications/Application.vue index 7584d11..890ff52 100644 --- a/src/views/Applications/Application.vue +++ b/src/views/Applications/Application.vue @@ -4,9 +4,17 @@
{ this.$message.success(this.title + ' instalado', 2) + this.isInstalled() }) .catch(e => { this.$message.error('Não foi possível instalar o aplicativo', 3) }) }, + deleteApp () { + this.ecomApps.removeApplication(this.applicationObjId).then(() => this.isInstalled()) + }, isInstalled () { this.ecomApps.fetchStoreApplications(this.appId).then(app => { if (app && Array.isArray(app) && app.length) { - this.isInstalled = true + this.installed = true + this.applicationObjId = app[0]._id Object.assign(this.data, app[0].data) Object.assign(this.hidden_data, app[0].hidden_data) + } else { + this.installed = false } }) } @@ -101,6 +117,7 @@ export default { }, created () { this.fetchApplication() + this.isInstalled() } }