File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ import { ISTKData, ISeat } from "@/types";
55import { rgbToHex } from "." ;
66import { default as d3Extended } from "./d3" ;
77
8- const domSeatsToJSON = ( seats : ISeat [ ] ) => {
9- const seatsFromStore : Record < string , ISeat > = seats . reduce ( ( acc , seat ) => {
8+ const domSeatsToJSON = ( seatsFromStore : ISeat [ ] | Record < string , ISeat > ) => {
9+ seatsFromStore = ( seatsFromStore as ISeat [ ] ) . reduce ( ( acc , seat ) => {
1010 acc [ seat . id ] = seat ;
1111 return acc ;
1212 } , { } ) ;
@@ -17,7 +17,8 @@ const domSeatsToJSON = (seats: ISeat[]) => {
1717 id,
1818 x : + seat . attr ( square ? "x" : "cx" ) ,
1919 y : + seat . attr ( square ? "y" : "cy" ) ,
20- label : document . getElementById ( `${ seat . attr ( "id" ) } -label` ) ?. textContent ?. trim ( ) ?? seatsFromStore [ id ] ?. label ,
20+ label :
21+ document . getElementById ( `${ seat . attr ( "id" ) } -label` ) ?. textContent ?. trim ( ) ?? seatsFromStore [ id ] ?. label ?. trim ( ) ,
2122 status : seat . attr ( dataAttributes . status ) ,
2223 category : seat . attr ( dataAttributes . category ) ,
2324 square,
You can’t perform that action at this time.
0 commit comments