From 9e2bb5ef36b686ec619a069c65712f2d57c3a1cc Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 26 Sep 2019 20:12:24 +0200 Subject: Move oauth admin settings to initialstate Signed-off-by: Roeland Jago Douma Signed-off-by: npmbuildbot[bot] --- apps/oauth2/src/App.vue | 13 ++++++------- apps/oauth2/src/main.js | 13 ++++++++----- 2 files changed, 14 insertions(+), 12 deletions(-) (limited to 'apps/oauth2/src') diff --git a/apps/oauth2/src/App.vue b/apps/oauth2/src/App.vue index 58ea4b819a6..1d6998ce305 100644 --- a/apps/oauth2/src/App.vue +++ b/apps/oauth2/src/App.vue @@ -59,12 +59,17 @@ import OAuthItem from './components/OAuthItem'; export default { name: 'App', + props: { + clients: { + type: Array, + required: true + } + }, components: { OAuthItem }, data: function() { return { - clients: [], newClient: { name: '', redirectUri: '', @@ -73,12 +78,6 @@ export default { } }; }, - beforeMount: function() { - Axios.get(OC.generateUrl('apps/oauth2/clients')) - .then((response) => { - this.clients = response.data; - }); - }, methods: { deleteClient(id) { Axios.delete(OC.generateUrl('apps/oauth2/clients/{id}', {id: id})) diff --git a/apps/oauth2/src/main.js b/apps/oauth2/src/main.js index b200347d901..c5714497f3d 100644 --- a/apps/oauth2/src/main.js +++ b/apps/oauth2/src/main.js @@ -22,13 +22,16 @@ import Vue from 'vue'; import App from './App.vue'; +import { loadState } from 'nextcloud-initial-state' Vue.prototype.t = t; Vue.prototype.OC = OC; -const app = new Vue({ - render: h => h(App) -}).$mount('#oauth2'); - -export { app }; +const clients = loadState('oauth2', 'clients'); +const View = Vue.extend(App) +new View({ + propsData: { + clients + } +}).$mount('#oauth2'); -- cgit v1.2.3