Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions lib/Controller/PublicController.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,6 @@ public function getPoll(): JSONResponse {
return $this->response(function () {
return [
'poll' => $this->pollService->get($this->userSession->getShare()->getPollId()),
'options' => $this->optionService->list($this->userSession->getShare()->getPollId()),
'votes' => $this->voteService->list($this->userSession->getShare()->getPollId()),
'orphaned' => 0,
'comments' => $this->commentService->list($this->userSession->getShare()->getPollId()),
'shares' => $this->shareService->list($this->userSession->getShare()->getPollId()),
'subscribed' => $this->subscriptionService->get($this->userSession->getShare()->getPollId()),
];
});
}
Expand Down
19 changes: 9 additions & 10 deletions src/stores/poll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,24 +384,23 @@ export const usePollStore = defineStore('poll', {
return PublicAPI.getPoll(sessionStore.route.params.token)
}
if (sessionStore.route.name === 'vote') {
return PollsAPI.getFullPoll(
pollId ?? sessionStore.currentPollId,
)
return PollsAPI.getPoll(pollId ?? sessionStore.currentPollId)
}
return null
})()

if (!response) {
this.$reset()
return
}

this.$patch(response.data.poll)
votesStore.votes = response.data.votes
optionsStore.options = response.data.options
sharesStore.shares = response.data.shares
commentsStore.comments = response.data.comments
subscriptionStore.subscribed = response.data.subscribed
await Promise.all([
this.$patch(response.data.poll),
votesStore.load(),
optionsStore.load(),
sharesStore.load(),
commentsStore.load(),
subscriptionStore.load(),
])

this.meta.status = 'loaded'
} catch (error) {
Expand Down