Skip to content

Commit

Permalink
Merge branch 'main' into only-use-session-claims
Browse files Browse the repository at this point in the history
  • Loading branch information
pauljohanneskraft authored Nov 10, 2024
2 parents f761a8e + d348a61 commit 496d466
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ In this section, we describe all data related to educational videos to be shown
|title|LocalizedText|e.g. "Beta Blockers for Heart Failure"|May be localized.|
|youtubeId|LocalizedText|e.g. "XfgcXkq61k0"|Contains the video id from YouTube.|
|orderIndex|integer|e.g. 1|Since Firestore collections aren't necessarily ordered, we have this property to order the elements by on the clients. The list is supposed to be ordered ascending by `orderIndex`.|
|description|LocalizedText|-|Describes the content of the video; to be shown underneath the video.|

Embed links for YouTube: `https://youtube.com/embed/${youtubeId}`.
Short links for YouTube: `https://youtu.be/${youtubeId}`.
Expand Down
8 changes: 4 additions & 4 deletions functions/models/src/types/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ export const videoConverter = new Lazy(
title: localizedTextConverter.schema,
youtubeId: localizedTextConverter.schema,
orderIndex: z.number(),
description: z.string(),
description: localizedTextConverter.schema,
})
.transform((content) => new Video(content)),
encode: (object) => ({
title: localizedTextConverter.encode(object.title),
youtubeId: localizedTextConverter.encode(object.youtubeId),
orderIndex: object.orderIndex,
description: object.description,
description: localizedTextConverter.encode(object.description),
}),
}),
)
Expand All @@ -37,15 +37,15 @@ export class Video {
readonly title: LocalizedText
readonly youtubeId: LocalizedText
readonly orderIndex: number
readonly description: string
readonly description: LocalizedText

// Constructor

constructor(input: {
title: LocalizedText
youtubeId: LocalizedText
orderIndex: number
description: string
description: LocalizedText
}) {
this.title = input.title
this.youtubeId = input.youtubeId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export class StaticDataService extends SeedingService {
title: localizedTextConverter.schema,
youtubeId: localizedTextConverter.schema,
orderIndex: z.number(),
description: z.string(),
description: localizedTextConverter.schema,
})
.array(),
}),
Expand Down

0 comments on commit 496d466

Please sign in to comment.