Merge pull request 'fixed sort highest amount: needed parseFloat for right sort, were strings before' (#18) from staging into master

Reviewed-on: http://localhost:3000/zino/seatmapv2/pulls/18
This commit is contained in:
zino
2021-08-04 17:47:51 +02:00

View File

@@ -2,6 +2,7 @@ import { config } from "./config";
import * as I from "../types/types";
import * as XMLHelper from "./xmlhelper";
import * as jBoxHelper from "./jBoxHelper";
import Utils from "./utils";
export function addSeatToState(inSelectedSeat: I.JSCSelectedSeat): void {
addSeatObjToState(inSelectedSeat);
@@ -11,7 +12,7 @@ export function addSeatToState(inSelectedSeat: I.JSCSelectedSeat): void {
if (pricescaleObj) {
//const firstBuyerTypeID: string = pricescaleObj.buyer_type[0].id[0]; // needs to be highest amount
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]
const buyerTypeCode: string | undefined = XMLHelper.getBuyerTypeCodeByBuyerTypeID(mostExpensiveBuyerTypeID);
@@ -19,7 +20,7 @@ export function addSeatToState(inSelectedSeat: I.JSCSelectedSeat): void {
addSeatsItemToState(selectedSeatsArrItem);
}
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 {