Skip to content

Commit 4492391

Browse files
authored
Update Hearing Type Definition (#2009)
* fix(hearing): Updating hearing type to reflect data we're getting that is missing Hearing properties - it seems that Name, and HearingHost.GeneralCourtNumber/CommitteeCode are sometimes missing * chore(runtypes): Updating runtypes version to 6.6.0 to pick up the new verbose error messages
1 parent 4e446ab commit 4492391

8 files changed

Lines changed: 19 additions & 19 deletions

File tree

components/HearingsScheduled/calendarEvents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const useCalendarEvents = () => {
4242
eventList.push({
4343
index,
4444
type: e.type,
45-
name: e.content.Name,
45+
name: e.content.Name ?? "Hearing",
4646
id: e.content.EventId,
4747
location: e.content.Location.LocationName,
4848
fullDate: eventDate.toJSDate(),

components/db/events.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ type Hearing = BaseEvent & {
4949
}
5050
type HearingContent = BaseContent & {
5151
Description: string
52-
Name: string
52+
Name: string | null
5353
Status: string
5454
HearingHost: {
55-
CommitteeCode: string
56-
GeneralCourtNumber: number
55+
CommitteeCode: string | null
56+
GeneralCourtNumber: number | null
5757
}
5858
Location: HearingLocation
5959
HearingAgendas: {

functions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"luxon": "^2.3.1",
3030
"nanoid": "^3.3.2",
3131
"object-hash": "^3.0.0",
32-
"runtypes": "6.5.1",
32+
"runtypes": "6.6.0",
3333
"ssl-root-cas": "^1.3.1",
3434
"typesense": "^1.2.2",
3535
"zod": "^3.20.2"

functions/src/events/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ export const HearingLocation = Record({
6464
export type HearingContent = Static<typeof HearingContent>
6565
export const HearingContent = BaseEventContent.extend({
6666
Description: String,
67-
Name: String,
67+
Name: Nullable(String),
6868
Status: String,
6969
HearingHost: Record({
70-
CommitteeCode: String,
71-
GeneralCourtNumber: Number
70+
CommitteeCode: Nullable(String),
71+
GeneralCourtNumber: Nullable(Number)
7272
}),
7373
Location: HearingLocation,
7474
HearingAgendas: Array(

functions/src/hearings/search.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ export const {
104104
startsAt,
105105
month: schedule.toFormat("LLLL"),
106106
year: schedule.year,
107-
committeeCode: content.HearingHost?.CommitteeCode,
108-
committeeName,
107+
committeeCode: content.HearingHost?.CommitteeCode ?? undefined,
108+
committeeName: committeeName ?? undefined,
109109
locationName: content.Location?.LocationName,
110110
locationCity: content.Location?.City,
111111
chairNames: hearing.committeeChairs ?? [],

functions/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6532,10 +6532,10 @@ run-async@^2.4.0, run-async@^2.4.1:
65326532
resolved "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz"
65336533
integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==
65346534

6535-
runtypes@6.5.1:
6536-
version "6.5.1"
6537-
resolved "https://registry.npmjs.org/runtypes/-/runtypes-6.5.1.tgz"
6538-
integrity sha512-vYxcAYzC868ZY4BgazBomT9dpWHZnG3CH++5mhlVKGKqf2MzON4itmEmQt3uGTUOyipeUn7GALAN0nQhjPNRtA==
6535+
runtypes@6.6.0:
6536+
version "6.6.0"
6537+
resolved "https://registry.yarnpkg.com/runtypes/-/runtypes-6.6.0.tgz#48e353d8b0f641ab5ec5d80fa96dd7bd41ea3281"
6538+
integrity sha512-ddM7sgB3fyboDlBzEYFQ04L674sKjbs4GyW2W32N/5Ae47NRd/GyMASPC2PFw8drPHYGEcZ0mZ26r5RcB8msfQ==
65396539

65406540
rxjs@^7.5.4:
65416541
version "7.8.2"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
"react-select": "^5.2.2",
129129
"redux-mock-store": "^1.5.4",
130130
"redux-thunk": "^3.1.0",
131-
"runtypes": "6.5.1",
131+
"runtypes": "6.6.0",
132132
"sidebar-v2": "^0.4.0",
133133
"styled-components": "^5.3.3",
134134
"typesense": "^1.2.2",

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15771,10 +15771,10 @@ run-parallel@^1.1.9:
1577115771
dependencies:
1577215772
queue-microtask "^1.2.2"
1577315773

15774-
runtypes@6.5.1:
15775-
version "6.5.1"
15776-
resolved "https://registry.yarnpkg.com/runtypes/-/runtypes-6.5.1.tgz#125d9a50c3b7dd45db6e47d42bb1c411b4f3f008"
15777-
integrity sha512-vYxcAYzC868ZY4BgazBomT9dpWHZnG3CH++5mhlVKGKqf2MzON4itmEmQt3uGTUOyipeUn7GALAN0nQhjPNRtA==
15774+
runtypes@6.6.0:
15775+
version "6.6.0"
15776+
resolved "https://registry.yarnpkg.com/runtypes/-/runtypes-6.6.0.tgz#48e353d8b0f641ab5ec5d80fa96dd7bd41ea3281"
15777+
integrity sha512-ddM7sgB3fyboDlBzEYFQ04L674sKjbs4GyW2W32N/5Ae47NRd/GyMASPC2PFw8drPHYGEcZ0mZ26r5RcB8msfQ==
1577815778

1577915779
rxjs@^6.4.0, rxjs@^6.5.x, rxjs@^6.6.0:
1578015780
version "6.6.7"

0 commit comments

Comments
 (0)