Skip to content

Commit 179132a

Browse files
committed
feat: Added missing return to resolve promise
1 parent 5993fb7 commit 179132a

3 files changed

Lines changed: 20 additions & 5 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ CloudGraph AWS Provider will ask you what regions you would like to crawl and wi
7070
| Service | Relations |
7171
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
7272
| alb | ec2, elasticBeanstalkEnv, route53Record, securityGroup, subnet, vpc, wafV2WebAcl |
73-
| apiGatewayDomainName | apiGatewayHttpApi, apiGatewayRestApi |
74-
| apiGatewayHttpApi |apiGatewayDomainName |
73+
| apiGatewayDomainName | apiGatewayHttpApi, apiGatewayRestApi |
74+
| apiGatewayHttpApi | apiGatewayDomainName |
7575
| apiGatewayRestApi | apiGatewayDomainName, apiGatewayResource, apiGatewayStage, route53Record |
7676
| apiGatewayStage | apiGatewayRestApi, wafV2WebAcl |
7777
| apiGatewayResource | apiGatewayRestApi |

src/services/apiGatewayDomainName/data.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,15 @@ export const getDomainNamesForRegion = async (
5050
}
5151

5252
if (isEmpty(data)) {
53-
resolve([])
53+
return resolve([])
5454
}
5555

5656
const { NextToken: nextToken, Items: items = [] } = data || {}
5757

58+
if (isEmpty(items)) {
59+
return resolve([])
60+
}
61+
5862
logger.debug(lt.fetchedApiGwDomainNames(items.length))
5963

6064
domainNameList.push(...items)
@@ -96,14 +100,21 @@ const getAPIMappings = (
96100
}
97101

98102
if (isEmpty(data)) {
99-
resolve({
103+
return resolve({
100104
domainName,
101105
apiMappings: [],
102106
})
103107
}
104108

105109
const { NextToken: nextToken, Items: apiMappings = [] } = data || {}
106110

111+
if (isEmpty(apiMappings)) {
112+
return resolve({
113+
domainName,
114+
apiMappings: [],
115+
})
116+
}
117+
107118
apiMappingList.push(...apiMappings)
108119

109120
if (nextToken) {

src/services/apiGatewayHttpApi/data.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,15 @@ export const getHttpApisForRegion = async (apiGw: APIGW): Promise<Api[]> =>
4949
}
5050

5151
if (isEmpty(data)) {
52-
resolve([])
52+
return resolve([])
5353
}
5454

5555
const { NextToken: nextToken, Items: items = [] } = data || {}
5656

57+
if (isEmpty(items)) {
58+
return resolve([])
59+
}
60+
5761
httpApiList.push(...items)
5862

5963
if (nextToken) {

0 commit comments

Comments
 (0)