diff --git a/src/data/models/SiteCup.js b/src/data/models/SiteCup.js index abc892ef..332116d6 100644 --- a/src/data/models/SiteCup.js +++ b/src/data/models/SiteCup.js @@ -92,7 +92,7 @@ const SiteCup = Model.define( allowNull: true, defaultValue: null, }, - Double: { + Multiplier: { type: DataType.INTEGER, allowNull: false, defaultValue: 0, diff --git a/src/utils/cups.js b/src/utils/cups.js index c03a954d..87b0cf5c 100644 --- a/src/utils/cups.js +++ b/src/utils/cups.js @@ -24,8 +24,8 @@ export const pointsSystem2 = [ 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, ]; -const getPoints = (pos, pointSystem, double) => { - const multiplier = double ? 2 : 1; +const getPoints = (pos, pointSystem, eventMultiplier) => { + const multiplier = eventMultiplier ? eventMultiplier : 1; let pts = points; if (pointSystem === 1) { pts = pointsSystem2; @@ -90,7 +90,7 @@ export const filterResults = (events, ownerId = [], loggedId = 0, cupGroup) => { combinedPoints += getPoints( drawPos, cupGroup?.PointSystem, - event.Double, + event.Multiplier, ); } const drawPoints = combinedPoints / draws.length; @@ -101,7 +101,7 @@ export const filterResults = (events, ownerId = [], loggedId = 0, cupGroup) => { filteredResults[pos].Points = getPoints( pos, cupGroup?.PointSystem, - event.Double, + event.Multiplier, ); filteredResults[pos].Position = pos + 1; }