Skip to content

Commit

Permalink
fix: number of assigned volunteers
Browse files Browse the repository at this point in the history
  • Loading branch information
machi1990 committed Jul 1, 2020
1 parent a3664cf commit 3cc93d7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions platform/server/src/resolvers/custom-resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export default {

// Let's do created automatic actions based on recipients needs.
// Volunteers will be picked randomly.
const pickedVolunteers = new Set<string>();
for (const recipient of newRecipients!) {
const labels = recipient.productsLabels;

Expand Down Expand Up @@ -107,7 +108,7 @@ export default {
}

const volunteerId = volunteerIds[volunteerIndex].toString();

pickedVolunteers.add(volunteerId);
const volunteerAction = {
title,
description: `Delivery of ${productsLabels}`,
Expand Down Expand Up @@ -138,7 +139,7 @@ export default {
date: now,
owner: "ovp-admin", // TODO retrieve this info from Keycloak context
numberOfCasesCreated,
numberOfVolunteersAssigned: newVolunteers!.length,
numberOfVolunteersAssigned: pickedVolunteers.size,
numberOfRecipients: newRecipients!.length
}, context)
}
Expand Down

0 comments on commit 3cc93d7

Please sign in to comment.