diff --git a/src/flow/flow.service.ts b/src/flow/flow.service.ts index d1034df..5886a5f 100644 --- a/src/flow/flow.service.ts +++ b/src/flow/flow.service.ts @@ -667,7 +667,7 @@ export class FlowService { // console.log('total:', total); if (total === 0) { - return allVotes.length / combinations(allProjects.length, 2); + return 0; } return effectiveVotes.length / total; @@ -918,6 +918,11 @@ export class FlowService { ), ); + if (pairs.length === 0 && collection) { + // Finishing the collection automatically + await this.finishCollection(userId, collection.id); + } + return { pairs, totalPairs: combinations.length,