Skip to content

Commit c4c2a34

Browse files
committed
fallback on null instead of empty strings
1 parent fab53d4 commit c4c2a34

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/property-base/src/types/building.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ export const buildingsQueryParamsSchema = z.object({
99
export const BuildingSchema = z.object({
1010
id: z.string(),
1111
code: z.string(),
12-
name: z.string(),
12+
name: z.string().nullable(),
1313
buildingType: z.object({
14-
id: z.string(),
15-
code: z.string(),
16-
name: z.string(),
14+
id: z.string().nullable(),
15+
code: z.string().nullable(),
16+
name: z.string().nullable(),
1717
}),
1818
construction: z.object({
1919
constructionYear: z.number().nullable(),

packages/property-base/src/utils/buildings.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ export function transformBuildingData(
1919
return {
2020
id: building.id,
2121
code: building.buildingCode,
22-
name: building.name || '',
22+
name: building.name || null,
2323
buildingType: {
24-
id: building.buildingType?.id || '',
25-
code: building.buildingType?.code || '',
26-
name: building.buildingType?.name || '',
24+
id: building.buildingType?.id || null,
25+
code: building.buildingType?.code || null,
26+
name: building.buildingType?.name || null,
2727
},
2828
construction: {
2929
constructionYear: building.constructionYear,

0 commit comments

Comments
 (0)