feat: add author id to class
This commit is contained in:
parent
049601a6fb
commit
37a35d5aab
|
@ -1,12 +1,18 @@
|
|||
class Author {
|
||||
private readonly _id: string;
|
||||
private readonly _name: string;
|
||||
private readonly _avatarHash: string;
|
||||
|
||||
constructor(json: any) {
|
||||
this._id = json.id;
|
||||
this._name = json.name;
|
||||
this._avatarHash = json.avatarHash;
|
||||
}
|
||||
|
||||
get id(): string {
|
||||
return this._id;
|
||||
}
|
||||
|
||||
get name(): string {
|
||||
return this._name;
|
||||
}
|
||||
|
@ -15,4 +21,5 @@ class Author {
|
|||
return this._avatarHash;
|
||||
}
|
||||
}
|
||||
|
||||
export default Author;
|
Loading…
Reference in New Issue