Skip to content

Commit

Permalink
feat(mainMedia): make id required (#10255)
Browse files Browse the repository at this point in the history
it is sent by Frontend
  • Loading branch information
mxdvl authored Jan 18, 2024
1 parent 068bf70 commit cf1dd55
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
5 changes: 1 addition & 4 deletions dotcom-rendering/src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,7 @@ export const Card = ({
defer={{ until: 'visible' }}
>
<YoutubeBlockComponent
id={
media.mainMedia.id ??
'unknown-media-id'
}
id={media.mainMedia.id}
assetId={
media.mainMedia.videoId
}
Expand Down
1 change: 1 addition & 0 deletions dotcom-rendering/src/model/article-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4441,6 +4441,7 @@
"duration",
"expired",
"height",
"id",
"images",
"origin",
"title",
Expand Down
1 change: 1 addition & 0 deletions dotcom-rendering/src/model/front-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3624,6 +3624,7 @@
"duration",
"expired",
"height",
"id",
"images",
"origin",
"title",
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/src/types/mainMedia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type Media = {
type Video = Media & {
type: 'Video';
/** @see https://github.com/guardian/frontend/blob/8e7e4d0e/common/app/model/content/Atom.scala#L159 */
id?: string;
id: string;
videoId: string;
height: number;
width: number;
Expand Down

0 comments on commit cf1dd55

Please sign in to comment.