Skip to content

Commit

Permalink
fix subscription
Browse files Browse the repository at this point in the history
Signed-off-by: dartcafe <[email protected]>
  • Loading branch information
dartcafe committed Aug 4, 2023
1 parent a224c7c commit 7cae4b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/js/Api/polls.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const polls = {
setSubscription(pollId, subscription) {
return httpInstance.request({
method: 'PUT',
url: `poll/${pollId}${subscription ? '/unsubscribe' : '/subscribe'}`,
url: `poll/${pollId}${subscription ? '/subscribe' : '/unsubscribe'}`,
cancelToken: cancelTokenHandlerObject[this.setSubscription.name].handleRequestCancellation().token,
})
},
Expand Down
4 changes: 2 additions & 2 deletions src/js/store/modules/subscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ const actions = {
try {
let response = null
if (context.rootState.route.name === 'publicVote') {
response = await PublicAPI.setSubscription(context.rootState.route.params.token)
response = await PublicAPI.setSubscription(context.rootState.route.params.token, !context.state.subscribed)
} else if (context.rootState.route.name === 'vote') {
response = await PollsAPI.setSubscription(context.rootState.route.params.id)
response = await PollsAPI.setSubscription(context.rootState.route.params.id, !context.state.subscribed)
} else {
context.commit('reset')
return
Expand Down

0 comments on commit 7cae4b4

Please sign in to comment.