From 36554caa647a524a2856f4b86d77803ee2b3b160 Mon Sep 17 00:00:00 2001 From: ThibaultBee <37510686+ThibaultBee@users.noreply.github.com> Date: Tue, 22 Oct 2024 11:04:59 +0200 Subject: [PATCH] fix(lib): fix `publishedAt` type --- lib/src/types/video.dart | 2 +- lib/src/types/video.g.dart | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/src/types/video.dart b/lib/src/types/video.dart index 6d17716..17af486 100644 --- a/lib/src/types/video.dart +++ b/lib/src/types/video.dart @@ -50,7 +50,7 @@ class Video { final String description; /// The date and time the API created the video. Date and time are provided using ISO-8601 UTC format. - final String publishedAt; + final DateTime publishedAt; /// The date and time the video was updated. Date and time are provided using ISO-8601 UTC format. final DateTime updatedAt; diff --git a/lib/src/types/video.g.dart b/lib/src/types/video.g.dart index 7c2ebe6..9e07f98 100644 --- a/lib/src/types/video.g.dart +++ b/lib/src/types/video.g.dart @@ -7,10 +7,11 @@ part of 'video.dart'; // ************************************************************************** Video _$VideoFromJson(Map json) => Video( - json['videoId'] as String, createdAt: DateTime.parse(json['createdAt'] as String), + json['videoId'] as String, + createdAt: DateTime.parse(json['createdAt'] as String), title: json['title'] as String, description: json['description'] as String, - publishedAt: json['publishedAt'] as String, + publishedAt: DateTime.parse(json['publishedAt'] as String), updatedAt: DateTime.parse(json['updatedAt'] as String), discardedAt: json['discardedAt'] == null ? null @@ -40,7 +41,7 @@ Map _$VideoToJson(Video instance) => { 'createdAt': instance.createdAt.toIso8601String(), 'title': instance.title, 'description': instance.description, - 'publishedAt': instance.publishedAt, + 'publishedAt': instance.publishedAt.toIso8601String(), 'updatedAt': instance.updatedAt.toIso8601String(), 'discardedAt': instance.discardedAt?.toIso8601String(), 'deletesAt': instance.deletesAt?.toIso8601String(),