File tree 1 file changed +20
-4
lines changed
1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,12 @@ function poll() {
12
12
type : 'repository' ,
13
13
body : {
14
14
size : 1000 ,
15
- fields : [ 'issue_events_url' ]
15
+ fields : [
16
+ 'id' ,
17
+ 'full_name' ,
18
+ 'name' ,
19
+ 'issue_events_url'
20
+ ]
16
21
}
17
22
} ;
18
23
return client . search ( options )
@@ -26,6 +31,11 @@ function poll() {
26
31
console . log ( 'Setting refreshInterval to ' , refreshInterval ) ;
27
32
}
28
33
return Promise . each ( data . body , function ( event ) {
34
+ event . repo = {
35
+ id : doc . fields . id [ 0 ] ,
36
+ name : doc . fields . name [ 0 ] ,
37
+ full_name : doc . fields . full_name [ 0 ]
38
+ } ;
29
39
var options = {
30
40
index : 'octojefe' ,
31
41
type : 'event' ,
@@ -43,12 +53,18 @@ function poll() {
43
53
. then ( function ( event ) {
44
54
if ( event ) {
45
55
console . log ( 'Updating event:' + event . id ) ;
56
+ var body = event . issue ;
57
+ body . repo = {
58
+ id : doc . fields . id [ 0 ] ,
59
+ name : doc . fields . name [ 0 ] ,
60
+ full_name : doc . fields . full_name [ 0 ]
61
+ } ;
46
62
var options = {
47
63
index : 'octojefe' ,
48
64
type : 'issue' ,
49
- body : event . issue ,
50
- id : 'issue:' + event . issue . id
51
- }
65
+ body : body ,
66
+ id : 'issue:' + body . id
67
+ } ;
52
68
return client . index ( options )
53
69
}
54
70
} )
You can’t perform that action at this time.
0 commit comments