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>2022-11-10 01:06:51 +0300
committerdartcafe <github@dartcafe.de>2022-11-10 01:06:51 +0300
commit20cd87e3fec2feb57c23834a6804bfcb162756c0 (patch)
tree7b8b8ca0ab2944ccec21f1b1e9c578c9889fb49c
parent97509e53a1a487ae3985170061d26df9287b551b (diff)
added error handling on canceled requests
Signed-off-by: dartcafe <github@dartcafe.de>
-rw-r--r--src/js/Api/AxiosHelper.js27
-rw-r--r--src/js/Api/activity.js4
-rw-r--r--src/js/Api/appSettings.js6
-rw-r--r--src/js/Api/calendar.js6
-rw-r--r--src/js/Api/comments.js8
-rw-r--r--src/js/Api/options.js20
-rw-r--r--src/js/Api/polls.js28
-rw-r--r--src/js/Api/public.js40
-rw-r--r--src/js/Api/shares.js16
-rw-r--r--src/js/Api/userSettings.js6
-rw-r--r--src/js/Api/validators.js6
-rw-r--r--src/js/Api/votes.js8
-rw-r--r--src/js/Exceptions/Exceptions.js11
-rw-r--r--src/js/components/Actions/ActionSendConfirmedOptions.vue7
-rw-r--r--src/js/components/Calendar/CalendarPeek.vue1
-rw-r--r--src/js/components/Export/ExportPoll.vue14
-rw-r--r--src/js/components/Poll/PublicRegisterModal.vue94
-rw-r--r--src/js/components/User/UserMenu.vue3
-rw-r--r--src/js/store/modules/activity.js3
-rw-r--r--src/js/store/modules/appSettings.js9
-rw-r--r--src/js/store/modules/combo.js3
-rw-r--r--src/js/store/modules/comments.js5
-rw-r--r--src/js/store/modules/options.js7
-rw-r--r--src/js/store/modules/poll.js21
-rw-r--r--src/js/store/modules/polls.js2
-rw-r--r--src/js/store/modules/pollsAdmin.js9
-rw-r--r--src/js/store/modules/settings.js16
-rw-r--r--src/js/store/modules/share.js7
-rw-r--r--src/js/store/modules/shares.js33
-rw-r--r--src/js/store/modules/subscription.js8
-rw-r--r--src/js/store/modules/votes.js8
31 files changed, 249 insertions, 187 deletions
diff --git a/src/js/Api/AxiosHelper.js b/src/js/Api/AxiosHelper.js
index 2002a452..f5ffbbe9 100644
--- a/src/js/Api/AxiosHelper.js
+++ b/src/js/Api/AxiosHelper.js
@@ -22,7 +22,6 @@
import axios from '@nextcloud/axios'
import { generateUrl, generateOcsUrl } from '@nextcloud/router'
-import { CancelledRequest } from '../Exceptions/Exceptions.js'
const clientSessionId = Math.random().toString(36).substring(2)
@@ -45,30 +44,6 @@ const CancelToken = axios.CancelToken
const axiosInstance = axios.create(axiosConfig)
const axiosOcsInstance = axios.create(axiosOcsConfig)
-const axiosRequest = (payload) => {
- try {
- const response = axiosInstance.request(payload)
- return response
- } catch (e) {
- if (axios.canceled()) {
- throw new CancelledRequest('Request cancelled')
- }
- throw e
- }
-}
-
-const axiosOcsRequest = (payload) => {
- try {
- const response = axiosOcsInstance.request(payload)
- return response
- } catch (e) {
- if (axios.canceled()) {
- throw new CancelledRequest('Request cancelled')
- }
- throw e
- }
-}
-
/**
* Description
*
@@ -107,4 +82,4 @@ const createCancelTokenHandler = (apiObject) => {
return cancelTokenHandler
}
-export { axiosConfig, axiosOcsInstance, axiosOcsRequest, axiosRequest, axiosInstance, createCancelTokenHandler }
+export { axiosConfig, axiosOcsInstance, axiosInstance, createCancelTokenHandler }
diff --git a/src/js/Api/activity.js b/src/js/Api/activity.js
index a951414f..749e2cf1 100644
--- a/src/js/Api/activity.js
+++ b/src/js/Api/activity.js
@@ -20,11 +20,11 @@
*
*/
-import { axiosOcsRequest, createCancelTokenHandler } from './AxiosHelper.js'
+import { axiosOcsInstance, createCancelTokenHandler } from './AxiosHelper.js'
const activity = {
getActivities(pollId) {
- const response = axiosOcsRequest({
+ const response = axiosOcsInstance.request({
method: 'GET',
url: 'activity/api/v2/activity/filter',
params: {
diff --git a/src/js/Api/appSettings.js b/src/js/Api/appSettings.js
index 064b4ac9..7a3e5e50 100644
--- a/src/js/Api/appSettings.js
+++ b/src/js/Api/appSettings.js
@@ -20,11 +20,11 @@
*
*/
-import { axiosRequest, createCancelTokenHandler } from './AxiosHelper.js'
+import { axiosInstance, createCancelTokenHandler } from './AxiosHelper.js'
const appSettings = {
getAppSettings() {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: 'settings/app',
params: { time: +new Date() },
@@ -33,7 +33,7 @@ const appSettings = {
},
writeAppSettings(appSettings) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'POST',
url: 'settings/app',
data: appSettings,
diff --git a/src/js/Api/calendar.js b/src/js/Api/calendar.js
index b359e19c..d6e0babd 100644
--- a/src/js/Api/calendar.js
+++ b/src/js/Api/calendar.js
@@ -20,11 +20,11 @@
*
*/
-import { axiosRequest, createCancelTokenHandler } from './AxiosHelper.js'
+import { axiosInstance, createCancelTokenHandler } from './AxiosHelper.js'
const calendar = {
getCalendars() {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: 'calendars',
params: { time: +new Date() },
@@ -32,7 +32,7 @@ const calendar = {
})
},
getEvents(pollId) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: `option/${pollId}/events`,
params: { time: +new Date() },
diff --git a/src/js/Api/comments.js b/src/js/Api/comments.js
index b5131eed..f3fb065b 100644
--- a/src/js/Api/comments.js
+++ b/src/js/Api/comments.js
@@ -20,11 +20,11 @@
*
*/
-import { axiosRequest, createCancelTokenHandler } from './AxiosHelper.js'
+import { axiosInstance, createCancelTokenHandler } from './AxiosHelper.js'
const comments = {
getComments(pollId) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: `poll/${pollId}/comments`,
params: { time: +new Date() },
@@ -32,7 +32,7 @@ const comments = {
})
},
addComment(pollId, message) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'POST',
url: `poll/${pollId}/comment`,
data: { message },
@@ -42,7 +42,7 @@ const comments = {
},
deleteComment(commentId) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'DELETE',
url: `comment/${commentId}`,
params: { time: +new Date() },
diff --git a/src/js/Api/options.js b/src/js/Api/options.js
index c1588971..650a681e 100644
--- a/src/js/Api/options.js
+++ b/src/js/Api/options.js
@@ -20,11 +20,11 @@
*
*/
-import { axiosRequest, createCancelTokenHandler } from './AxiosHelper.js'
+import { axiosInstance, createCancelTokenHandler } from './AxiosHelper.js'
const options = {
getOptions(pollId) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: `poll/${pollId}/options`,
params: { time: +new Date() },
@@ -33,7 +33,7 @@ const options = {
},
addOption(option) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'POST',
url: 'option',
data: { ...option },
@@ -42,7 +42,7 @@ const options = {
},
updateOption(option) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'PUT',
url: `option/${option.id}`,
// TODO: replace text with timestamp
@@ -52,7 +52,7 @@ const options = {
},
deleteOption(optionId) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'DELETE',
url: `option/${optionId}`,
params: { time: +new Date() },
@@ -61,7 +61,7 @@ const options = {
},
addOptions(pollId, optionsBatch) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'POST',
url: 'option/bulk',
data: {
@@ -73,7 +73,7 @@ const options = {
},
confirmOption(optionId) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'PUT',
url: `option/${optionId}/confirm`,
cancelToken: cancelTokenHandlerObject[this.confirmOption.name].handleRequestCancellation().token,
@@ -81,7 +81,7 @@ const options = {
},
reorderOptions(pollId, options) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'POST',
url: `poll/${pollId}/options/reorder`,
data: { options },
@@ -90,7 +90,7 @@ const options = {
},
addOptionsSequence(optionId, step, unit, amount) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'POST',
url: `option/${optionId}/sequence`,
data: {
@@ -103,7 +103,7 @@ const options = {
},
shiftOptions(pollId, step, unit) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'POST',
url: `poll/${pollId}/shift`,
data: {
diff --git a/src/js/Api/polls.js b/src/js/Api/polls.js
index 176e99ad..a5b9021b 100644
--- a/src/js/Api/polls.js
+++ b/src/js/Api/polls.js
@@ -20,11 +20,11 @@
*
*/
-import { axiosRequest, createCancelTokenHandler } from './AxiosHelper.js'
+import { axiosInstance, createCancelTokenHandler } from './AxiosHelper.js'
const polls = {
getPolls() {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: 'polls',
params: { time: +new Date() },
@@ -33,7 +33,7 @@ const polls = {
},
getPollsForAdmin() {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: 'administration/polls',
params: { time: +new Date() },
@@ -42,7 +42,7 @@ const polls = {
},
getPoll(pollId) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: `poll/${pollId}/poll`,
params: { time: +new Date() },
@@ -51,7 +51,7 @@ const polls = {
},
takeOver(pollId) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'PUT',
url: `apps/polls/administration/poll/${pollId}/takeover`,
cancelToken: cancelTokenHandlerObject[this.takeOver.name].handleRequestCancellation().token,
@@ -59,7 +59,7 @@ const polls = {
},
addPoll(type, title) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'POST',
url: 'poll/add',
data: {
@@ -71,7 +71,7 @@ const polls = {
},
updatePoll(poll) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'PUT',
url: `poll/${poll.id}`,
data: { poll },
@@ -80,7 +80,7 @@ const polls = {
},
deletePoll(pollId) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'DELETE',
url: `poll/${pollId}`,
cancelToken: cancelTokenHandlerObject[this.deletePoll.name].handleRequestCancellation().token,
@@ -88,7 +88,7 @@ const polls = {
},
toggleArchive(pollId) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'PUT',
url: `poll/${pollId}/toggleArchive`,
cancelToken: cancelTokenHandlerObject[this.toggleArchive.name].handleRequestCancellation().token,
@@ -96,7 +96,7 @@ const polls = {
},
clonePoll(pollId) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'POST',
url: `poll/${pollId}/clone`,
cancelToken: cancelTokenHandlerObject[this.clonePoll.name].handleRequestCancellation().token,
@@ -104,7 +104,7 @@ const polls = {
},
sendConfirmation(pollId) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'POST',
url: `poll/${pollId}/confirmation`,
cancelToken: cancelTokenHandlerObject[this.sendConfirmation.name].handleRequestCancellation().token,
@@ -112,7 +112,7 @@ const polls = {
},
getParticipantsEmailAddresses(pollId) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: `poll/${pollId}/addresses`,
cancelToken: cancelTokenHandlerObject[this.getParticipantsEmailAddresses.name].handleRequestCancellation().token,
@@ -120,7 +120,7 @@ const polls = {
},
getSubscription(pollId) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: `poll/${pollId}/subscription`,
cancelToken: cancelTokenHandlerObject[this.getSubscription.name].handleRequestCancellation().token,
@@ -128,7 +128,7 @@ const polls = {
},
setSubscription(pollId, subscription) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'PUT',
url: `poll/${pollId}${subscription ? '/subscribe' : '/unsubscribe'}`,
cancelToken: cancelTokenHandlerObject[this.setSubscription.name].handleRequestCancellation().token,
diff --git a/src/js/Api/public.js b/src/js/Api/public.js
index 40f28f25..362665fc 100644
--- a/src/js/Api/public.js
+++ b/src/js/Api/public.js
@@ -20,11 +20,11 @@
*
*/
-import { axiosRequest, createCancelTokenHandler } from './AxiosHelper.js'
+import { axiosInstance, createCancelTokenHandler } from './AxiosHelper.js'
const publicPoll = {
getPoll(shareToken) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: `/s/${shareToken}/poll`,
params: { time: +new Date() },
@@ -33,7 +33,7 @@ const publicPoll = {
},
watch(shareToken) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: `s/${shareToken}/watch`,
cancelToken: cancelTokenHandlerObject[this.watch.name].handleRequestCancellation().token,
@@ -41,7 +41,7 @@ const publicPoll = {
},
getOptions(shareToken) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: `/s/${shareToken}/options`,
params: { time: +new Date() },
@@ -50,7 +50,7 @@ const publicPoll = {
},
addOption(shareToken, option) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'POST',
url: `/s/${shareToken}/option`,
data: { ...option },
@@ -59,7 +59,7 @@ const publicPoll = {
},
deleteOption(shareToken, optionId) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'DELETE',
url: `s/${shareToken}/option/${optionId}`,
params: { time: +new Date() },
@@ -68,7 +68,7 @@ const publicPoll = {
},
getVotes(shareToken) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: `/s/${shareToken}/votes`,
params: { time: +new Date() },
@@ -77,7 +77,7 @@ const publicPoll = {
},
setVote(shareToken, optionId, setTo) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'PUT',
url: `s/${shareToken}/vote`,
data: { optionId, setTo },
@@ -86,7 +86,7 @@ const publicPoll = {
},
removeVotes(shareToken) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'DELETE',
url: `s/${shareToken}/user`,
cancelToken: cancelTokenHandlerObject[this.removeVotes.name].handleRequestCancellation().token,
@@ -94,7 +94,7 @@ const publicPoll = {
},
getComments(shareToken) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: `/s/${shareToken}/comments`,
params: { time: +new Date() },
@@ -103,7 +103,7 @@ const publicPoll = {
},
addComment(shareToken, message) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'POST',
url: `s/${shareToken}/comment`,
data: { message },
@@ -113,7 +113,7 @@ const publicPoll = {
},
deleteComment(shareToken, commentId) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'DELETE',
url: `s/${shareToken}/${commentId}`,
params: { time: +new Date() },
@@ -123,7 +123,7 @@ const publicPoll = {
},
getShare(shareToken) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: `s/${shareToken}/share`,
params: { time: +new Date() },
@@ -132,7 +132,7 @@ const publicPoll = {
},
setEmail(shareToken, emailAddress) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'PUT',
url: `s/${shareToken}/email/${emailAddress}`,
params: { time: +new Date() },
@@ -141,7 +141,7 @@ const publicPoll = {
},
deleteEmailAddress(shareToken) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'DELETE',
url: `s/${shareToken}/email`,
params: { time: +new Date() },
@@ -150,7 +150,7 @@ const publicPoll = {
},
setDisplayName(shareToken, displayName) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'PUT',
url: `s/${shareToken}/name/${displayName}`,
params: { time: +new Date() },
@@ -159,7 +159,7 @@ const publicPoll = {
},
resendInvitation(shareToken) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'POST',
url: `s/${shareToken}/resend`,
params: { time: +new Date() },
@@ -168,7 +168,7 @@ const publicPoll = {
},
getSubscription(shareToken) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: `s/${shareToken}/subscription`,
cancelToken: cancelTokenHandlerObject[this.getSubscription.name].handleRequestCancellation().token,
@@ -176,7 +176,7 @@ const publicPoll = {
},
setSubscription(shareToken, subscription) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'PUT',
url: `s/${shareToken}${subscription ? '/subscribe' : '/unsubscribe'}`,
cancelToken: cancelTokenHandlerObject[this.setSubscription.name].handleRequestCancellation().token,
@@ -184,7 +184,7 @@ const publicPoll = {
},
register(shareToken, userName, emailAddress, timeZone) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'POST',
url: `s/${shareToken}/register`,
data: {
diff --git a/src/js/Api/shares.js b/src/js/Api/shares.js
index 4a48ee40..880bc733 100644
--- a/src/js/Api/shares.js
+++ b/src/js/Api/shares.js
@@ -20,11 +20,11 @@
*
*/
-import { axiosRequest, createCancelTokenHandler } from './AxiosHelper.js'
+import { axiosInstance, createCancelTokenHandler } from './AxiosHelper.js'
const shares = {
getShares(pollId) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: `poll/${pollId}/shares`,
params: { time: +new Date() },
@@ -33,7 +33,7 @@ const shares = {
},
addShare(pollId, share) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'POST',
url: `poll/${pollId}/share`,
data: {
@@ -44,7 +44,7 @@ const shares = {
},
switchAdmin(shareToken, setTo) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'PUT',
url: `share/${shareToken}/${setTo}`,
params: { time: +new Date() },
@@ -53,7 +53,7 @@ const shares = {
},
setEmailAddressConstraint(shareToken, setTo) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'PUT',
url: `share/${shareToken}/publicpollemail/${setTo}`,
params: { time: +new Date() },
@@ -62,7 +62,7 @@ const shares = {
},
sendInvitation(shareToken) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'POST',
url: `share/${shareToken}/invite`,
params: { time: +new Date() },
@@ -71,7 +71,7 @@ const shares = {
},
resolveShare(shareToken) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: `share/${shareToken}/resolve`,
params: { time: +new Date() },
@@ -80,7 +80,7 @@ const shares = {
},
deleteShare(shareToken) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'DELETE',
url: `share/${shareToken}`,
params: { time: +new Date() },
diff --git a/src/js/Api/userSettings.js b/src/js/Api/userSettings.js
index 17ab77cb..59f8c06f 100644
--- a/src/js/Api/userSettings.js
+++ b/src/js/Api/userSettings.js
@@ -20,11 +20,11 @@
*
*/
-import { axiosRequest, createCancelTokenHandler } from './AxiosHelper.js'
+import { axiosInstance, createCancelTokenHandler } from './AxiosHelper.js'
const userSettings = {
getUserSettings() {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: 'preferences',
params: { time: +new Date() },
@@ -33,7 +33,7 @@ const userSettings = {
},
writeUserSettings(settings) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'POST',
url: 'settings/app',
data: settings,
diff --git a/src/js/Api/validators.js b/src/js/Api/validators.js
index dbbfdc70..9401bab3 100644
--- a/src/js/Api/validators.js
+++ b/src/js/Api/validators.js
@@ -20,11 +20,11 @@
*
*/
-import { axiosRequest, createCancelTokenHandler } from './AxiosHelper.js'
+import { axiosInstance, createCancelTokenHandler } from './AxiosHelper.js'
const validators = {
validateEmailAddress(emailAddress) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: `check/emailaddress/${emailAddress}`,
cancelToken: cancelTokenHandlerObject[this.validateEmailAddress.name].handleRequestCancellation().token,
@@ -32,7 +32,7 @@ const validators = {
},
validateName(pollToken, name) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'POST',
url: 'check/username',
cancelToken: cancelTokenHandlerObject[this.validateName.name].handleRequestCancellation().token,
diff --git a/src/js/Api/votes.js b/src/js/Api/votes.js
index 2ff1586e..1e56347b 100644
--- a/src/js/Api/votes.js
+++ b/src/js/Api/votes.js
@@ -20,11 +20,11 @@
*
*/
-import { axiosRequest, createCancelTokenHandler } from './AxiosHelper.js'
+import { axiosInstance, createCancelTokenHandler } from './AxiosHelper.js'
const votes = {
getVotes(pollId) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'GET',
url: `poll/${pollId}/votes`,
params: { time: +new Date() },
@@ -33,7 +33,7 @@ const votes = {
},
setVote(optionId, setTo) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'PUT',
url: 'vote',
data: { optionId, setTo },
@@ -42,7 +42,7 @@ const votes = {
},
removeUser(pollId, userId = null) {
- return axiosRequest({
+ return axiosInstance.request({
method: 'DELETE',
url: userId ? `poll/${pollId}/user/${userId}` : `poll/${pollId}/user`,
cancelToken: cancelTokenHandlerObject[this.removeUser.name].handleRequestCancellation().token,
diff --git a/src/js/Exceptions/Exceptions.js b/src/js/Exceptions/Exceptions.js
index 83a56a17..4e5ae135 100644
--- a/src/js/Exceptions/Exceptions.js
+++ b/src/js/Exceptions/Exceptions.js
@@ -47,13 +47,4 @@ class InvalidJSON extends Error {
}
-class CancelledRequest extends Error {
-
- constructor(message) {
- super(message)
- this.name = 'cancelledRequest'
- }
-
-}
-
-export { Exception, InvalidJSON, NotReady, CancelledRequest }
+export { Exception, InvalidJSON, NotReady }
diff --git a/src/js/components/Actions/ActionSendConfirmedOptions.vue b/src/js/components/Actions/ActionSendConfirmedOptions.vue
index b161c73c..76a105a3 100644
--- a/src/js/components/Actions/ActionSendConfirmedOptions.vue
+++ b/src/js/components/Actions/ActionSendConfirmedOptions.vue
@@ -76,7 +76,12 @@ export default {
methods: {
async clickAction() {
- this.confirmations = await PollsAPI.sendConfirmation(this.$route.params.id)
+ try {
+ this.confirmations = await PollsAPI.sendConfirmation(this.$route.params.id)
+ } catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
+ }
+
this.headerCaption = t('polls', 'Confirmations processed')
this.confirmations.sent.forEach((confirmation) => {
showSuccess(t('polls', `Confirmation sent to ${confirmation}`))
diff --git a/src/js/components/Calendar/CalendarPeek.vue b/src/js/components/Calendar/CalendarPeek.vue
index f2a7ea88..474ba2f3 100644
--- a/src/js/components/Calendar/CalendarPeek.vue
+++ b/src/js/components/Calendar/CalendarPeek.vue
@@ -119,6 +119,7 @@ export default {
const response = CalendarAPI.getEvents(this.option.pollId)
this.events = response.data.events
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
if (e.message === 'Network Error') {
showError(t('polls', 'Got a network error while checking calendar events.'))
}
diff --git a/src/js/components/Export/ExportPoll.vue b/src/js/components/Export/ExportPoll.vue
index 3e5254d8..7d0ee8fa 100644
--- a/src/js/components/Export/ExportPoll.vue
+++ b/src/js/components/Export/ExportPoll.vue
@@ -126,11 +126,15 @@ export default {
}
if (this.isOwner) {
- participantsHeader.push(t('polls', 'Email address'))
- fromHeader.push('')
- toHeader.push('')
- const response = await PollsAPI.getParticipantsEmailAddresses(this.$route.params.id)
- this.emailAddresses = response.data
+ try {
+ participantsHeader.push(t('polls', 'Email address'))
+ fromHeader.push('')
+ toHeader.push('')
+ const response = await PollsAPI.getParticipantsEmailAddresses(this.$route.params.id)
+ this.emailAddresses = response.data
+ } catch (error) {
+ if (error.name === 'CanceledError') return
+ }
}
if (this.poll.type === 'textPoll') {
diff --git a/src/js/components/Poll/PublicRegisterModal.vue b/src/js/components/Poll/PublicRegisterModal.vue
index 57cc3ac6..5a5d1e6d 100644
--- a/src/js/components/Poll/PublicRegisterModal.vue
+++ b/src/js/components/Poll/PublicRegisterModal.vue
@@ -104,6 +104,8 @@ import { ValidatorAPI } from '../../Api/validators.js'
import { PublicAPI } from '../../Api/public.js'
import { setCookie } from '../../helpers/cookieHelper.js'
+const COOKIE_LIFETIME = 30
+
export default {
name: 'PublicRegisterModal',
@@ -288,8 +290,13 @@ export default {
try {
await ValidatorAPI.validateName(this.$route.params.token, this.userName)
this.status.userName = 'valid'
- } catch {
- this.status.userName = 'invalid'
+ } catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
+ if (e?.code === 'ERR_BAD_REQUEST') {
+ this.status.userName = 'invalid'
+ return
+ }
+ throw e
}
}, 500),
@@ -298,46 +305,63 @@ export default {
try {
await ValidatorAPI.validateEmailAddress(this.emailAddress)
this.status.email = 'valid'
- } catch {
- this.status.email = 'valid'
+ } catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
+ if (e?.code === 'ERR_BAD_REQUEST') {
+ this.status.email = 'invalid'
+ return
+ }
+ throw e
}
}, 500),
- async submitRegistration() {
- if (this.registrationIsValid) {
- try {
- const response = await PublicAPI.register(
- this.$route.params.token,
- this.userName,
- this.emailAddress,
- )
-
- if (this.saveCookie && this.$route.params.type === 'public') {
- const cookieExpiration = (30 * 24 * 60 * 1000)
- setCookie(this.$route.params.token, response.data.share.token, cookieExpiration)
- }
+ updateCookie(value) {
+ const cookieExpiration = (COOKIE_LIFETIME * 24 * 60 * 1000)
+ setCookie(this.$route.params.token, value, cookieExpiration)
+ },
- if (this.$route.params.token === response.data.share.token) {
- // if share was not a public share, but a personal share
- // (i.e. email shares allow to change personal data by fist entering of the poll),
- // just load the poll
- this.$store.dispatch({ type: 'poll/get' })
- this.closeModal()
- } else {
- // in case of a public share, redirect to the generated share
- this.redirecting = true
- this.$router.replace({ name: 'publicVote', params: { token: response.data.share.token } })
- this.closeModal()
- }
+ routeToPersonalShare(token) {
+ if (this.$route.params.token === token) {
+ // if share was not a public share, but a personal share
+ // (i.e. email shares allow to change personal data by fist entering of the poll),
+ // just load the poll
+ this.$store.dispatch({ type: 'poll/get' })
+ this.closeModal()
+ } else {
+ // in case of a public share, redirect to the generated share
+ this.redirecting = true
+ this.$router.replace({ name: 'publicVote', params: { token } })
+ this.closeModal()
+ }
- // TODO: Is that correct, is this possible in any way?
- if (this.share.emailAddress && !this.share.invitationSent) {
- showError(t('polls', 'Email could not be sent to {emailAddress}', { emailAddress: this.share.emailAddress }))
- }
- } catch (e) {
- showError(t('polls', 'Error registering to poll', { error: e.response }))
+ },
+
+ async submitRegistration() {
+ if (!this.registrationIsValid) {
+ return
+ }
+
+ try {
+ const response = await PublicAPI.register(
+ this.$route.params.token,
+ this.userName,
+ this.emailAddress,
+ )
+
+ if (this.saveCookie && this.$route.params.type === 'public') {
+ this.updateCookie(response.data.share.token)
}
+ this.routeToPersonalShare(response.data.share.token)
+
+ // TODO: Is that correct, is this possible in any way?
+ if (this.share.emailAddress && !this.share.invitationSent) {
+ showError(t('polls', 'Email could not be sent to {emailAddress}', { emailAddress: this.share.emailAddress }))
+ }
+ } catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
+ showError(t('polls', 'Error registering to poll', { error: e.response }))
+ throw e
}
},
},
diff --git a/src/js/components/User/UserMenu.vue b/src/js/components/User/UserMenu.vue
index 605d7f65..234198d5 100644
--- a/src/js/components/User/UserMenu.vue
+++ b/src/js/components/User/UserMenu.vue
@@ -334,7 +334,8 @@ export default {
const response = await PollsAPI.getParticipantsEmailAddresses(this.$route.params.id)
await navigator.clipboard.writeText(response.data.map((item) => item.combined))
showSuccess(t('polls', 'Link copied to clipboard'))
- } catch {
+ } catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
showError(t('polls', 'Error while copying link to clipboard'))
}
},
diff --git a/src/js/store/modules/activity.js b/src/js/store/modules/activity.js
index 9bb5e2f2..117b9dd8 100644
--- a/src/js/store/modules/activity.js
+++ b/src/js/store/modules/activity.js
@@ -51,7 +51,8 @@ const actions = {
try {
const response = await ActivityAPI.getActivities(context.rootState.route.params.id)
context.commit('set', response.data.ocs.data)
- } catch (error) {
+ } catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
context.commit('reset')
}
},
diff --git a/src/js/store/modules/appSettings.js b/src/js/store/modules/appSettings.js
index 7fcc62db..d27bc23e 100644
--- a/src/js/store/modules/appSettings.js
+++ b/src/js/store/modules/appSettings.js
@@ -72,7 +72,7 @@ const actions = {
try {
const response = await AppSettingsAPI.getAppSettings()
context.commit('set', response.data.appSettings)
- } catch {
+ } catch (e) {
// context.commit('reset')
}
},
@@ -82,10 +82,9 @@ const actions = {
const response = await AppSettingsAPI.writeAppSettings(context.state)
context.commit('set', response.data.appSettings)
} catch (e) {
- if (e.name !== 'CancelledRequest') {
- console.error('Error writing appSettings', { error: e.response }, { appSettings: state })
- throw e
- }
+ if (e?.code === 'ERR_CANCELED') return
+ console.error('Error writing appSettings', { error: e.response }, { appSettings: state })
+ throw e
}
},
}
diff --git a/src/js/store/modules/combo.js b/src/js/store/modules/combo.js
index 6adc9a0b..df2f3b57 100644
--- a/src/js/store/modules/combo.js
+++ b/src/js/store/modules/combo.js
@@ -147,6 +147,7 @@ const actions = {
const response = await PollsAPI.getPoll(payload.pollId)
context.commit('addPoll', response.data)
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.debug('Error loading poll for combo', { error: e.response })
}
},
@@ -156,6 +157,7 @@ const actions = {
const response = await OptionsAPI.getOptions(payload.pollId)
context.commit('addOptions', response.data)
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.debug('Error loading options for combo', { error: e.response })
}
},
@@ -165,6 +167,7 @@ const actions = {
const response = await VotesAPI.getVotes(payload.pollId)
context.commit('addVotes', response.data)
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.debug('Error loading options for combo', { error: e.response })
}
},
diff --git a/src/js/store/modules/comments.js b/src/js/store/modules/comments.js
index f3c66d3c..b745e1e5 100644
--- a/src/js/store/modules/comments.js
+++ b/src/js/store/modules/comments.js
@@ -68,7 +68,8 @@ const actions = {
}
context.commit('set', response.data)
- } catch {
+ } catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
context.commit('reset')
}
},
@@ -87,6 +88,7 @@ const actions = {
context.dispatch('list')
// context.commit('add', { comment: response.data.comment })
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error writing comment', { error: e.response }, { payload })
throw e
}
@@ -102,6 +104,7 @@ const actions = {
context.commit('delete', { comment: payload.comment })
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error deleting comment', { error: e.response }, { payload })
throw e
}
diff --git a/src/js/store/modules/options.js b/src/js/store/modules/options.js
index 96e969f4..50321173 100644
--- a/src/js/store/modules/options.js
+++ b/src/js/store/modules/options.js
@@ -150,6 +150,7 @@ const actions = {
context.commit('set', { options: response.data.options })
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error loding options', { error: e.response }, { pollId: context.rootState.route.params.id })
throw e
}
@@ -180,6 +181,7 @@ const actions = {
}
context.commit('setItem', { option: response.data.option })
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error(`Error adding option: ${e.response.data}`, { error: e.response }, { payload })
context.dispatch('list')
throw e
@@ -206,6 +208,7 @@ const actions = {
}
context.commit('delete', { option: payload.option })
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error deleting option', { error: e.response }, { payload })
context.dispatch('list')
throw e
@@ -217,6 +220,7 @@ const actions = {
const response = OptionsAPI.addOptions(context.rootState.route.params.id, payload.text)
context.commit('set', { options: response.data.options })
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error(`Error adding option: ${e.response.data}`, { error: e.response }, { payload })
context.dispatch('list')
throw e
@@ -229,6 +233,7 @@ const actions = {
const response = OptionsAPI.confirmOption(payload.optionId)
context.commit('setItem', { option: response.data.option })
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error confirming option', { error: e.response }, { payload })
context.dispatch('list')
throw e
@@ -258,6 +263,7 @@ const actions = {
)
context.commit('set', { options: response.data.options })
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error creating sequence', { error: e.response }, { payload })
context.dispatch('list')
throw e
@@ -273,6 +279,7 @@ const actions = {
)
context.commit('set', { options: response.data.options })
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error shifting dates', { error: e.response }, { payload })
context.dispatch('list')
throw e
diff --git a/src/js/store/modules/poll.js b/src/js/store/modules/poll.js
index 14aedb22..9807381d 100644
--- a/src/js/store/modules/poll.js
+++ b/src/js/store/modules/poll.js
@@ -186,6 +186,7 @@ const actions = {
context.commit('set', response.data)
context.commit('acl/set', response.data)
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.debug('Error loading poll', { error: e })
throw e
}
@@ -194,12 +195,13 @@ const actions = {
async add(context, payload) {
try {
const response = await PollsAPI.addPoll(payload.type, payload.title)
+ context.dispatch('polls/list', null, { root: true })
return response
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error adding poll:', { error: e.response }, { state: context.state })
- throw e
- } finally {
context.dispatch('polls/list', null, { root: true })
+ throw e
}
},
@@ -208,32 +210,37 @@ const actions = {
const response = await PollsAPI.updatePoll(context.state)
context.commit('set', response.data)
context.commit('acl/set', response.data)
+ context.dispatch('polls/list', null, { root: true })
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error updating poll:', { error: e.response }, { poll: context.state })
context.dispatch('get')
- throw e
- } finally {
context.dispatch('polls/list', null, { root: true })
+ throw e
}
},
async delete(context, payload) {
try {
await PollsAPI.deletePoll(payload.pollId)
+ context.dispatch('polls/list', null, { root: true })
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error deleting poll', { error: e.response }, { payload })
- } finally {
context.dispatch('polls/list', null, { root: true })
+ throw e
}
},
async toggleArchive(context, payload) {
try {
await PollsAPI.toggleArchive(payload.pollId)
+ context.dispatch('polls/list', null, { root: true })
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error archiving/restoring', { error: e.response }, { payload })
- } finally {
context.dispatch('polls/list', null, { root: true })
+ throw e
}
},
@@ -243,7 +250,9 @@ const actions = {
context.dispatch('polls/list', null, { root: true })
return response
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error cloning poll', { error: e.response }, { payload })
+ throw e
}
},
}
diff --git a/src/js/store/modules/polls.js b/src/js/store/modules/polls.js
index 17c0ad94..b62dfe15 100644
--- a/src/js/store/modules/polls.js
+++ b/src/js/store/modules/polls.js
@@ -202,7 +202,9 @@ const actions = {
context.commit('setPollCreationAllowed', { pollCreationAllowed: response.data.pollCreationAllowed })
context.commit('setComboAllowed', { comboAllowed: response.data.comboAllowed })
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error loading polls', { error: e.response })
+ throw e
}
},
}
diff --git a/src/js/store/modules/pollsAdmin.js b/src/js/store/modules/pollsAdmin.js
index f718948e..49c43f47 100644
--- a/src/js/store/modules/pollsAdmin.js
+++ b/src/js/store/modules/pollsAdmin.js
@@ -49,7 +49,9 @@ const actions = {
const response = await PollsAPI.getPollsForAdmin()
context.commit('set', { list: response.data })
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error loading polls', { error: e.response })
+ throw e
}
},
@@ -58,7 +60,12 @@ const actions = {
return
}
- PollsAPI.takeOver(payload.pollId)
+ try {
+ PollsAPI.takeOver(payload.pollId)
+ } catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
+ throw e
+ }
},
}
diff --git a/src/js/store/modules/settings.js b/src/js/store/modules/settings.js
index c2ef1c66..1794030f 100644
--- a/src/js/store/modules/settings.js
+++ b/src/js/store/modules/settings.js
@@ -136,8 +136,10 @@ const actions = {
response.data.preferences.defaultViewDatePoll = 'list-view'
}
context.commit('setPreference', response.data.preferences)
- } catch {
+ } catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
context.commit('reset')
+ throw e
}
},
@@ -153,15 +155,21 @@ const actions = {
const response = await UserSettingsAPI.writeUserSettings(context.state.user)
context.commit('setPreference', response.data.preferences)
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error writing preferences', { error: e.response }, { preferences: state.user })
throw e
}
},
async getCalendars(context) {
- const response = await CalendarAPI.getCalendars()
- context.commit('setCalendars', { calendars: response.data.calendars })
- return response
+ try {
+ const response = await CalendarAPI.getCalendars()
+ context.commit('setCalendars', { calendars: response.data.calendars })
+ return response
+ } catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
+ throw e
+ }
},
}
diff --git a/src/js/store/modules/share.js b/src/js/store/modules/share.js
index e671f938..006731d4 100644
--- a/src/js/store/modules/share.js
+++ b/src/js/store/modules/share.js
@@ -64,8 +64,9 @@ const actions = {
context.commit('set', { share: response.data.share })
return response.data
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.debug('Error retrieving share', { error: e.response })
- throw e.response
+ throw e
}
},
@@ -79,6 +80,7 @@ const actions = {
context.commit('set', { share: response.data.share })
context.dispatch('poll/get', null, { root: true })
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error writing email address', { error: e.response }, { payload })
throw e
}
@@ -97,6 +99,7 @@ const actions = {
context.dispatch('votes/list', null, { root: true })
context.dispatch('options/list', null, { root: true })
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error changing name', { error: e.response }, { payload })
throw e
}
@@ -113,6 +116,7 @@ const actions = {
context.dispatch('subscription/update', false, { root: true })
context.dispatch('poll/get', null, { root: true })
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error writing email address', { error: e.response }, { payload })
throw e
}
@@ -126,6 +130,7 @@ const actions = {
try {
return await PublicAPI.resendInvitation(context.rootState.route.params.token)
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error sending invitation', { error: e.response }, { payload })
throw e
}
diff --git a/src/js/store/modules/shares.js b/src/js/store/modules/shares.js
index 9fce6d73..2d670187 100644
--- a/src/js/store/modules/shares.js
+++ b/src/js/store/modules/shares.js
@@ -74,6 +74,7 @@ const actions = {
const response = await SharesAPI.getShares(context.rootState.route.params.id)
context.commit('set', response.data)
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error loading shares', { error: e.response }, { pollId: context.rootState.route.params.id })
throw e
}
@@ -82,11 +83,12 @@ const actions = {
async add(context, payload) {
try {
await SharesAPI.addShare(context.rootState.route.params.id, payload.share)
+ context.dispatch('list')
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error writing share', { error: e.response }, { payload })
- throw e
- } finally {
context.dispatch('list')
+ throw e
}
},
@@ -95,33 +97,37 @@ const actions = {
try {
await SharesAPI.switchAdmin(payload.share.token, setTo)
+ context.dispatch('list')
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error(`Error switching type to ${setTo}`, { error: e.response }, { payload })
- throw e
- } finally {
context.dispatch('list')
+ throw e
}
},
async setPublicPollEmail(context, payload) {
try {
await SharesAPI.setEmailAddressConstraint(payload.share.token, payload.value)
+ context.dispatch('list')
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error changing email register setting', { error: e.response }, { payload })
- throw e
- } finally {
context.dispatch('list')
+ throw e
}
},
async sendInvitation(context, payload) {
try {
- return await SharesAPI.sendInvitation(payload.share.token)
+ const response = await SharesAPI.sendInvitation(payload.share.token)
+ context.dispatch('list')
+ return response
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error sending invitation', { error: e.response }, { payload })
- throw e
- } finally {
context.dispatch('list')
+ throw e
}
},
@@ -129,11 +135,11 @@ const actions = {
try {
await SharesAPI.resolveShare(payload.share.token)
+ context.dispatch('list')
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error exploding group', e.response.data, { error: e.response }, { payload })
throw e
- } finally {
- context.dispatch('list')
}
},
@@ -141,11 +147,12 @@ const actions = {
context.commit('delete', { share: payload.share })
try {
await SharesAPI.deleteShare(payload.share.token)
+ context.dispatch('list')
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error removing share', { error: e.response }, { payload })
- throw e
- } finally {
context.dispatch('list')
+ throw e
}
},
}
diff --git a/src/js/store/modules/subscription.js b/src/js/store/modules/subscription.js
index 837c1736..08a3c089 100644
--- a/src/js/store/modules/subscription.js
+++ b/src/js/store/modules/subscription.js
@@ -57,12 +57,14 @@ const actions = {
return
}
context.commit('set', response.data)
- } catch {
+ } catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
context.commit('set', false)
+ throw e
}
},
- async update(context, payload) {
+ async update(context) {
try {
let response = null
if (context.rootState.route.name === 'publicVote') {
@@ -75,7 +77,9 @@ const actions = {
}
context.commit('set', response.data)
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error(e.response)
+ throw e
}
},
}
diff --git a/src/js/store/modules/votes.js b/src/js/store/modules/votes.js
index 16f94ed1..3af685d7 100644
--- a/src/js/store/modules/votes.js
+++ b/src/js/store/modules/votes.js
@@ -90,6 +90,7 @@ const actions = {
context.commit('reset')
return
}
+
const votes = []
response.data.votes.forEach((vote) => {
if (vote.answer === 'yes') {
@@ -105,8 +106,10 @@ const actions = {
votes.push(vote)
})
context.commit('set', votes)
- } catch {
+ } catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
context.commit('reset')
+ throw e
}
},
@@ -123,6 +126,7 @@ const actions = {
context.dispatch('poll/get', null, { root: true })
return response
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
if (e.response.status === 409) {
context.dispatch('list')
context.dispatch('options/list', null, { root: true })
@@ -143,6 +147,7 @@ const actions = {
}
context.commit('deleteVotes', { userId: response.data.deleted })
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error deleting votes', { error: e.response })
throw e
}
@@ -153,6 +158,7 @@ const actions = {
await VotesAPI.removeUser(context.rootState.route.params.id, payload.userId)
context.commit('deleteVotes', payload)
} catch (e) {
+ if (e?.code === 'ERR_CANCELED') return
console.error('Error deleting votes', { error: e.response }, { payload })
throw e
}