@@ -33,25 +33,48 @@ export interface FirestorePullRequest {
3333}
3434
3535export class PullRequest extends GithubBaseModel < FirestorePullRequest > {
36- readonly owner = this . data . owner ;
37- readonly repo = this . data . repo ;
38- readonly node = this . data . node ;
39- readonly state = this . data . state ;
40- readonly authorAssociation = this . data . authorAssociation ;
41- readonly changeFiles = this . data . changedFiles ;
42- readonly closedAt = this . data . closedAt ;
43- readonly commits = this . data . commits ;
44- readonly createdAt = this . data . createdAt ;
45- readonly draft = this . data . draft ;
46- readonly labels = this . data . labels ;
47- readonly maintainerCanModify = this . data . maintainerCanModify ;
48- readonly number = this . data . number ;
49- readonly requestedReviewers = this . data . requestedReviewers ;
50- readonly title = this . data . title ;
51- readonly milestone = this . data . milestone ;
52- readonly assignees = this . data . assignees ;
53- readonly user = this . data . user ;
54- readonly commit = this . data . commit ;
36+ owner ! : string ;
37+ repo ! : string ;
38+ node ! : string ;
39+ state ! : string ;
40+ authorAssociation ! : string ;
41+ changeFiles ! : number ;
42+ closedAt ! : string | null ;
43+ commits ! : number ;
44+ createdAt ! : string ;
45+ draft ! : boolean ;
46+ labels ! : Label [ ] ;
47+ maintainerCanModify ! : boolean ;
48+ number ! : number ;
49+ requestedReviewers ! : User [ ] ;
50+ title ! : string ;
51+ milestone ! : Milestone | null ;
52+ assignees ! : User [ ] ;
53+ user ! : User ;
54+ commit ! : string ;
55+ target : undefined | string ;
56+
57+ override async setData ( data : FirestorePullRequest ) {
58+ this . owner = data . owner ;
59+ this . repo = data . repo ;
60+ this . node = data . node ;
61+ this . state = data . state ;
62+ this . authorAssociation = data . authorAssociation ;
63+ this . changeFiles = data . changedFiles ;
64+ this . closedAt = data . closedAt ;
65+ this . commits = data . commits ;
66+ this . createdAt = data . createdAt ;
67+ this . draft = data . draft ;
68+ this . maintainerCanModify = data . maintainerCanModify ;
69+ this . number = data . number ;
70+ this . requestedReviewers = data . requestedReviewers as any ;
71+ this . title = data . title ;
72+ this . milestone = data . milestone as any ;
73+ this . assignees = data . assignees as any ;
74+ this . commit = data . commit ;
75+ User . getByReference ( data . user ) . then ( ( u ) => ( this . user = u ) ) ;
76+ Promise . all ( data . labels . map ( ( l ) => Label . getByReference ( l ) ) ) . then ( ( l ) => ( this . labels = l ) ) ;
77+ }
5578
5679 static override githubHelpers : GithubHelperFunctions <
5780 PullRequest ,
0 commit comments