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:
Diffstat (limited to 'src/js/store/modules/pollsAdmin.js')
-rw-r--r--src/js/store/modules/pollsAdmin.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/js/store/modules/pollsAdmin.js b/src/js/store/modules/pollsAdmin.js
index 52076bf1..a0182d42 100644
--- a/src/js/store/modules/pollsAdmin.js
+++ b/src/js/store/modules/pollsAdmin.js
@@ -27,11 +27,11 @@ import axios from '@nextcloud/axios'
import { getCurrentUser } from '@nextcloud/auth'
import { generateUrl } from '@nextcloud/router'
+const namespaced = true
const state = {
list: [],
}
-
-const namespaced = true
+const axiosDefaultConfig = { headers: { Accept: 'application/json' } }
const mutations = {
set(state, payload) {
@@ -52,7 +52,7 @@ const actions = {
const endPoint = 'apps/polls/administration/polls'
try {
const response = await axios.get(generateUrl(endPoint), {
- headers: { Accept: 'application/json' },
+ ...axiosDefaultConfig,
params: { time: +new Date() },
})
context.commit('set', { list: response.data })
@@ -67,9 +67,7 @@ const actions = {
}
const endPoint = `apps/polls/administration/poll/${payload.pollId}/takeover`
- axios.put(generateUrl(endPoint), {
- headers: { Accept: 'application/json' },
- })
+ axios.put(generateUrl(endPoint), null, axiosDefaultConfig)
},
}