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
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/store/modules/subModules
parentaf77c5cba4642761c644cae761fbedcc82acc4e6 (diff)
remove trailing backslashes from routes
Diffstat (limited to 'src/js/store/modules/subModules')
-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
3 files changed, 19 insertions, 19 deletions
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), {