File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
src/registry/routes/helpers Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import request from 'minimal-request';
4
4
import url from 'url' ;
5
5
import { Component , Config } from '../../../types' ;
6
6
import * as urlBuilder from '../../domain/url-builder' ;
7
+ import { GetComponentResult } from './get-component' ;
7
8
8
9
type ComponentCallback = (
9
10
err : { registryError : any ; fallbackError : any } | null ,
@@ -77,14 +78,7 @@ export function getComponent(
77
78
fallbackRegistryUrl : string ,
78
79
headers : IncomingHttpHeaders ,
79
80
component : { name : string ; version : string ; parameters : IncomingHttpHeaders } ,
80
- callback : (
81
- result :
82
- | {
83
- status : number ;
84
- response : { code : string ; error : Error } ;
85
- }
86
- | Component
87
- ) => void
81
+ callback : ( result : GetComponentResult ) => void
88
82
) : void {
89
83
return request (
90
84
{
@@ -94,7 +88,7 @@ export function getComponent(
94
88
json : true ,
95
89
body : { components : [ component ] }
96
90
} ,
97
- ( err , res : Component [ ] ) => {
91
+ ( err , res : GetComponentResult [ ] ) => {
98
92
if ( err || ! res || res . length === 0 ) {
99
93
return callback ( {
100
94
status : 404 ,
You can’t perform that action at this time.
0 commit comments