diff --git a/src/structure/manga.js b/src/structure/manga.js index a33a40c..711bec4 100644 --- a/src/structure/manga.js +++ b/src/structure/manga.js @@ -202,10 +202,13 @@ class Manga { this.state = context.data.attributes.state; /** - * The the id of the latest uploaded chapter - * @type {String} + * The latest uploaded chapter for this manga + * @type {Relationship} */ - this.latestUploadedChapter = context.data.attributes.latestUploadedChapter; + this.latestUploadedChapter = context.data.attributes.latestUploadedChapter ? new Relationship({ + id: context.data.attributes.latestUploadedChapter, + type: 'chapter' + }) : null; } /**