fixed sort highest amount: needed parseFloat for right sort, were strings before
This commit is contained in:
@@ -2,6 +2,7 @@ import { config } from "./config";
|
|||||||
import * as I from "../types/types";
|
import * as I from "../types/types";
|
||||||
import * as XMLHelper from "./xmlhelper";
|
import * as XMLHelper from "./xmlhelper";
|
||||||
import * as jBoxHelper from "./jBoxHelper";
|
import * as jBoxHelper from "./jBoxHelper";
|
||||||
|
import Utils from "./utils";
|
||||||
|
|
||||||
export function addSeatToState(inSelectedSeat: I.JSCSelectedSeat): void {
|
export function addSeatToState(inSelectedSeat: I.JSCSelectedSeat): void {
|
||||||
addSeatObjToState(inSelectedSeat);
|
addSeatObjToState(inSelectedSeat);
|
||||||
@@ -11,7 +12,7 @@ export function addSeatToState(inSelectedSeat: I.JSCSelectedSeat): void {
|
|||||||
if (pricescaleObj) {
|
if (pricescaleObj) {
|
||||||
//const firstBuyerTypeID: string = pricescaleObj.buyer_type[0].id[0]; // needs to be highest amount
|
//const firstBuyerTypeID: string = pricescaleObj.buyer_type[0].id[0]; // needs to be highest amount
|
||||||
const mostExpensiveBuyerTypeID: string = pricescaleObj.buyer_type.reduce((prev, current) => {
|
const mostExpensiveBuyerTypeID: string = pricescaleObj.buyer_type.reduce((prev, current) => {
|
||||||
return (prev.price[0] > current.price[0]) ? prev : current
|
return (parseFloat(prev.price[0]) > parseFloat(current.price[0])) ? prev : current
|
||||||
}).id[0]
|
}).id[0]
|
||||||
|
|
||||||
const buyerTypeCode: string | undefined = XMLHelper.getBuyerTypeCodeByBuyerTypeID(mostExpensiveBuyerTypeID);
|
const buyerTypeCode: string | undefined = XMLHelper.getBuyerTypeCodeByBuyerTypeID(mostExpensiveBuyerTypeID);
|
||||||
@@ -19,7 +20,7 @@ export function addSeatToState(inSelectedSeat: I.JSCSelectedSeat): void {
|
|||||||
addSeatsItemToState(selectedSeatsArrItem);
|
addSeatsItemToState(selectedSeatsArrItem);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
console.warn(`Cannot find corresponding venueXML pricescaleObj for pricescale with ID ${pricescaleID}`);
|
Utils.consoleLog(`Cannot find corresponding venueXML pricescaleObj for pricescale with ID ${pricescaleID}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function removeSeatFromState(inSelectedSeat: I.JSCSelectedSeat): void {
|
export function removeSeatFromState(inSelectedSeat: I.JSCSelectedSeat): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user