@@ -12,23 +12,44 @@ export const convertPropertyValue = (
1212 return property . string ;
1313 }
1414 if ( propertyType . value === 'boolean' ) {
15- return Boolean ( property . boolean ) ;
15+ // Handle case where number is stored as string in the API
16+ if ( property . boolean != null ) {
17+ return Boolean ( property . boolean ) ;
18+ }
19+ if ( ( property . string != null && property . string === '1' ) || property . string === '0' ) {
20+ return Boolean ( property . string ) ;
21+ }
22+ return undefined ;
1623 }
1724 if ( propertyType . value === 'point' ) {
18- return property . point ;
25+ // Handle case where point is stored as string in the API
26+ if ( property . point != null ) {
27+ return property . point ;
28+ }
29+ if ( property . string != null ) {
30+ return property . point ;
31+ }
32+ return undefined ;
1933 }
2034 if ( propertyType . value === 'number' ) {
2135 // Handle case where number is stored as string in the API
2236 if ( property . number != null ) {
2337 return Number ( property . number ) ;
2438 }
25- if ( property . string != null ) {
39+ if ( property . string != null && property . string !== '' && ! Number . isNaN ( Number ( property . string ) ) ) {
2640 return Number ( property . string ) ;
2741 }
2842 return undefined ;
2943 }
3044 if ( propertyType . value === 'date' ) {
31- return property . time ;
45+ // Handle case where date is stored as string in the API
46+ if ( property . time != null ) {
47+ return new Date ( property . time ) ;
48+ }
49+ if ( property . string != null && property . string !== '' ) {
50+ return new Date ( property . string ) ;
51+ }
52+ return undefined ;
3253 }
3354 }
3455} ;
0 commit comments