Skip to content

Commit 3b10cc3

Browse files
authored
Merge pull request #1752 from boazsender/automated-transcriptions
Use Optional over Nullable for optional fields.
2 parents 3ff729e + 06310bc commit 3b10cc3

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

functions/src/events/scrapeEvents.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ class HearingScraper extends EventScraper<HearingListItem, Hearing> {
211211
id: `hearing-${EventId}`,
212212
type: "hearing",
213213
content,
214-
videoURL: maybeVideoURL,
215-
videoFetchedAt: maybeVideoURL ? Timestamp.now() : null,
216-
videoAssemblyId: transcript ? transcript.id : null,
214+
videoURL: maybeVideoURL ? maybeVideoURL : undefined,
215+
videoFetchedAt: maybeVideoURL ? Timestamp.now() : undefined,
216+
videoAssemblyId: transcript ? transcript.id : undefined,
217217
...this.timestamps(content)
218218
}
219219
return event

functions/src/events/types.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
Literal as L,
55
Null,
66
Number,
7+
Optional,
78
Record,
89
Runtype,
910
Static,
@@ -77,9 +78,9 @@ export type Hearing = Static<typeof Hearing>
7778
export const Hearing = BaseEvent.extend({
7879
type: L("hearing"),
7980
content: HearingContent,
80-
videoURL: Nullable(String),
81-
videoAssemblyId: Nullable(String),
82-
videoFetchedAt: Nullable(InstanceOf(Timestamp))
81+
videoURL: Optional(String),
82+
videoAssemblyId: Optional(String),
83+
videoFetchedAt: Optional(InstanceOf(Timestamp))
8384
})
8485

8586
export type Event = Static<typeof Event>

0 commit comments

Comments
 (0)