Extract configQuery function

This commit is contained in:
Peter Stuifzand 2020-08-18 23:05:22 +02:00
parent 16ea750006
commit 7a498393f8

View File

@ -205,19 +205,18 @@ export default new Vuex.Store({
} }
}) })
}, },
fetchSyndicationTargets() { configQuery: function (key) {
let micropub = new Micropub({ let micropub = new Micropub({
token: this.state.access_token, token: this.state.access_token,
micropubEndpoint: this.state.micropubEndpoint micropubEndpoint: this.state.micropubEndpoint
}) })
return micropub.query('syndicate-to') return micropub.query(key)
},
fetchSyndicationTargets() {
return this.configQuery('syndicate-to')
}, },
fetchDestinations() { fetchDestinations() {
let micropub = new Micropub({ return this.configQuery('destination');
token: this.state.access_token,
micropubEndpoint: this.state.micropubEndpoint
})
return micropub.query('destination')
}, },
micropubPost(_, mf2post) { micropubPost(_, mf2post) {
let micropub = new Micropub({ let micropub = new Micropub({