From 01c3ea3d32cd4836ab1c6cb728dc994a9231e341 Mon Sep 17 00:00:00 2001 From: Kekskurse Date: Thu, 20 Jun 2019 19:07:08 +0200 Subject: [PATCH] Stuff --- src/services/Apps.js | 6 +++++ src/views/AppDetails.vue | 52 ++++++++++++++++++++++++++++++++-------- 2 files changed, 48 insertions(+), 10 deletions(-) diff --git a/src/services/Apps.js b/src/services/Apps.js index 73668543..f68dd746 100644 --- a/src/services/Apps.js +++ b/src/services/Apps.js @@ -18,5 +18,11 @@ export default { }, allowAccess(id, redirect_uri, scope) { return Api().post('/v1/app/'+id+'/access/allow', {redirect_uri: redirect_uri, scope:scope}); + }, + updateApp(app) { + return Api().put("/v1/app/"+app.id, app); + }, + getUser(id) { + return Api().get('/v1/app/'+id+'/user') } } \ No newline at end of file diff --git a/src/views/AppDetails.vue b/src/views/AppDetails.vue index 274e45f5..dd4bd215 100644 --- a/src/views/AppDetails.vue +++ b/src/views/AppDetails.vue @@ -3,7 +3,7 @@ - +

App {{ app.name }}

Overview API Access Settings - Users + Permissions + Users @@ -78,20 +79,20 @@ - + Speichern IMAGE +
- +

+ Beim ändern der Permissions müssen alle User den Zugriff erneut bestätigen. +

+
+
+ + + + + + + + + +
Username
{{ user.username }}
@@ -169,19 +185,35 @@ data () { return { app: null, - imageUrl: '' + imageUrl: '', + appUser: [] } }, components: { "Login": LoginComponent }, methods: { - + 'updateSettings': function () { + AppService.updateApp(this.app).then((res) => { + if(res.data.success) { + alert("Änderung erfolgreich gespeichert"); + } else { + alert("FEHLER: "+res.data.msg); + } + this.app = res.data.data; + }, (res) => { + alert("FEHLER: "+res.response.data.msg); + }) + } }, mounted: function() { AppService.getApp(this.$route.params.id).then((res) => { this.app = res.data.data; }) + AppService.getUser(this.$route.params.id).then((res) => { + console.log("Users", res.data.data) + this.appUser = res.data.data; + }) this.imageUrl = AppService.getAppImage(this.$route.params.id); } }