Skip to content

Commit

Permalink
#5 fix correctly sorting cumulitive votes
Browse files Browse the repository at this point in the history
  • Loading branch information
scammo committed Apr 3, 2024
1 parent 0ab9366 commit 66dc0d8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions frontend/src/views/orga/ProposalsTrack.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ const loadPoposals = async () => {
proposal.created_at = dayjs(proposal.created_at).format(
"DD.MM.YYYY HH:mm"
);
const vote_average = proposal.opinions.reduce(
const vote_average = +proposal.opinions.reduce(
(accumulator, currentValue) => (parseFloat(accumulator) + parseFloat(currentValue.vote)).toFixed(2),
0
);
const comments_count = proposal.opinions.filter(
(opinion) => !!opinion.comment && opinion.comment !== ""
(opinion) => !!opinion.commvote_averageent && opinion.comment !== ""
).length;
const vote_count = proposal.opinions.filter(
(opinion) => opinion.vote !== null
Expand Down Expand Up @@ -180,7 +180,6 @@ const rowClass = (data) => {
<ProgressSpinner />
</template>
<template v-else>
<pre>{{ proposals.value }}</pre>
<DataTable :value="proposals" :rowClass="rowClass" striped-rows show-gridlines selection-mode="single" data-key="id"
table-style="min-width: 50rem" @rowSelect="onRowSelect">
<template #empty> Keine Bewerbungen mit diesem Filter gefunden. </template>
Expand Down

0 comments on commit 66dc0d8

Please sign in to comment.