Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/js
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2020-06-20 23:13:27 +0300
committerdartcafe <github@dartcafe.de>2020-06-20 23:13:27 +0300
commit9f98851cf5fc5a1bc6811c9d432e8c0464b9763d (patch)
tree550244cbefd6697ef16d2acbf1242a5a6e85eadf /src/js
parentaf77c5cba4642761c644cae761fbedcc82acc4e6 (diff)
remove trailing backslashes from routes
Diffstat (limited to 'src/js')
-rw-r--r--src/js/components/SideBar/SideBarTabShare.vue2
-rw-r--r--src/js/store/modules/polls.js2
-rw-r--r--src/js/store/modules/subModules/options.js30
-rw-r--r--src/js/store/modules/subModules/shares.js2
-rw-r--r--src/js/store/modules/subModules/votes.js6
-rw-r--r--src/js/store/modules/subscription.js8
6 files changed, 27 insertions, 23 deletions
diff --git a/src/js/components/SideBar/SideBarTabShare.vue b/src/js/components/SideBar/SideBarTabShare.vue
index 62cdbe1b..095a1ecf 100644
--- a/src/js/components/SideBar/SideBarTabShare.vue
+++ b/src/js/components/SideBar/SideBarTabShare.vue
@@ -146,7 +146,7 @@ export default {
loadUsersAsync(query) {
this.isLoading = false
this.siteUsersListOptions.query = query
- axios.post(generateUrl('apps/polls/siteusers/get/'), this.siteUsersListOptions)
+ axios.post(generateUrl('apps/polls/siteusers/get'), this.siteUsersListOptions)
.then((response) => {
this.users = response.data.siteusers
this.isLoading = false
diff --git a/src/js/store/modules/polls.js b/src/js/store/modules/polls.js
index c5b18e2f..e52a4c00 100644
--- a/src/js/store/modules/polls.js
+++ b/src/js/store/modules/polls.js
@@ -71,7 +71,7 @@ const getters = {
const actions = {
load(context) {
- const endPoint = 'apps/polls/polls/list/'
+ const endPoint = 'apps/polls/polls/list'
return axios.get(generateUrl(endPoint))
.then((response) => {
diff --git a/src/js/store/modules/subModules/options.js b/src/js/store/modules/subModules/options.js
index 9f5547c1..ae18c1d0 100644
--- a/src/js/store/modules/subModules/options.js
+++ b/src/js/store/modules/subModules/options.js
@@ -112,21 +112,8 @@ const actions = {
})
},
- update(context, payload) {
- const endPoint = 'apps/polls/option/update'
-
- return axios.post(generateUrl(endPoint), { option: payload.option })
- .then((response) => {
- context.commit('setItem', { option: response.data })
- })
- .catch((error) => {
- console.error('Error updating option', { error: error.response }, { payload: payload })
- throw error
- })
- },
-
add(context, payload) {
- const endPoint = 'apps/polls/option/add/'
+ const endPoint = 'apps/polls/option/add'
const option = {}
option.id = 0
@@ -157,8 +144,21 @@ const actions = {
})
},
+ update(context, payload) {
+ const endPoint = 'apps/polls/option/update'
+
+ return axios.post(generateUrl(endPoint), { option: payload.option })
+ .then((response) => {
+ context.commit('setItem', { option: response.data })
+ })
+ .catch((error) => {
+ console.error('Error updating option', { error: error.response }, { payload: payload })
+ throw error
+ })
+ },
+
delete(context, payload) {
- const endPoint = 'apps/polls/option/remove/'
+ const endPoint = 'apps/polls/option/remove'
return axios.post(generateUrl(endPoint), { option: payload.option })
.then(() => {
diff --git a/src/js/store/modules/subModules/shares.js b/src/js/store/modules/subModules/shares.js
index 237edab7..f5fe4fa4 100644
--- a/src/js/store/modules/subModules/shares.js
+++ b/src/js/store/modules/subModules/shares.js
@@ -127,7 +127,7 @@ const actions = {
},
addPersonal(context, payload) {
- const endPoint = 'apps/polls/share/create/s/'
+ const endPoint = 'apps/polls/share/create/s'
return axios.post(generateUrl(endPoint), { token: payload.token, userName: payload.userName })
.then((response) => {
diff --git a/src/js/store/modules/subModules/votes.js b/src/js/store/modules/subModules/votes.js
index 3c70472d..a09cccae 100644
--- a/src/js/store/modules/subModules/votes.js
+++ b/src/js/store/modules/subModules/votes.js
@@ -115,7 +115,7 @@ const getters = {
const actions = {
delete(context, payload) {
- const endPoint = 'apps/polls/votes/delete/'
+ const endPoint = 'apps/polls/votes/delete'
return axios.post(generateUrl(endPoint), {
pollId: context.rootState.poll.id,
voteId: 0,
@@ -132,10 +132,10 @@ const actions = {
},
set(context, payload) {
- let endPoint = 'apps/polls/vote/set/'
+ let endPoint = 'apps/polls/vote/set'
if (context.rootState.poll.acl.foundByToken) {
- endPoint = endPoint.concat('s/')
+ endPoint = endPoint.concat('/s')
}
return axios.post(generateUrl(endPoint), {
diff --git a/src/js/store/modules/subscription.js b/src/js/store/modules/subscription.js
index 61492ac2..725c0b04 100644
--- a/src/js/store/modules/subscription.js
+++ b/src/js/store/modules/subscription.js
@@ -41,8 +41,11 @@ const mutations = {
}
const actions = {
+
getSubscription(context, payload) {
- axios.get(generateUrl('apps/polls/subscription/get/' + payload.pollId))
+ const endPoint = 'apps/polls/subscription/get'
+
+ return axios.get(generateUrl(endPoint.concat('/', payload.pollId)))
.then(() => {
context.commit('setSubscription', true)
})
@@ -52,7 +55,8 @@ const actions = {
},
writeSubscriptionPromise(context, payload) {
- return axios.post(generateUrl('apps/polls/subscription/set/'), { pollId: payload.pollId, subscribed: state.subscribed })
+ const endPoint = 'apps/polls/subscription/set'
+ return axios.post(generateUrl(endPoint), { pollId: payload.pollId, subscribed: state.subscribed })
.then(() => {
})
.catch((error) => {