File tree Expand file tree Collapse file tree 2 files changed +19
-17
lines changed
frontend/components/Project Expand file tree Collapse file tree 2 files changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,9 @@ const description = getDescription()
5757const parsedIdObj = Util .parseProjectId (project .id ! )
5858const org = parsedIdObj .owner
5959const repo = parsedIdObj .repo
60- const link = ` /projects/${org }/${repo }/ `
60+ const path = parsedIdObj .path ;
61+ const pathPart = path ? ` ::${path .split (" /" ).join (" ::" )} ` : " "
62+ const link = ` /projects/${org }/${repo }${pathPart } `
6163 </script >
6264
6365 <style lang="scss" scoped>
Original file line number Diff line number Diff line change @@ -172,25 +172,25 @@ export class Github {
172172 const res = results ? results : [ ] ;
173173
174174 var that = this ;
175- return fetch ( url , this . getFullOptions ( ) )
176- . then ( res => res . json ( ) )
177- . then ( response => {
178- const data = response . body ;
179- const headers = response . headers ;
180-
181- const newResults = res . concat ( data ) ;
182-
183- if ( headers . link ) {
184- const linkHeader = parselh ( headers . link ) ;
185- if ( linkHeader . next ) {
186- return that . readAllPages ( linkHeader . next . url , newResults ) ;
187- } else {
188- return newResults ;
189- }
175+ return fetch ( url , this . getFullOptions ( ) ) . then ( async response => {
176+ if ( ! response . ok ) {
177+ console . error ( "Failed to fetch" , url ) ;
178+ return res ;
179+ }
180+ const data = await response . json ( ) ;
181+ const headers = response . headers ;
182+ const newResults = res . concat ( data ) ;
183+ if ( headers . get ( "link" ) ) {
184+ const linkHeader = parselh ( headers . get ( "link" ) ) ;
185+ if ( linkHeader . next ) {
186+ return that . readAllPages ( linkHeader . next . url , newResults ) ;
190187 } else {
191188 return newResults ;
192189 }
193- } ) ;
190+ } else {
191+ return newResults ;
192+ }
193+ } ) ;
194194 }
195195
196196 /**
You can’t perform that action at this time.
0 commit comments