Skip to content

Commit

Permalink
Convert latestUploadedChapter to a Relationship
Browse files Browse the repository at this point in the history
  • Loading branch information
md-y committed Oct 1, 2022
1 parent ad15517 commit c6114c3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/structure/manga.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<Chapter>}
*/
this.latestUploadedChapter = context.data.attributes.latestUploadedChapter;
this.latestUploadedChapter = context.data.attributes.latestUploadedChapter ? new Relationship({
id: context.data.attributes.latestUploadedChapter,
type: 'chapter'
}) : null;
}

/**
Expand Down

0 comments on commit c6114c3

Please sign in to comment.