Skip to content

Commit df957fe

Browse files
committed
fix(apigw): apiId undefined compatibility
1 parent 19555ff commit df957fe

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/baas/apigw/index.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ class Apigw {
178178
})
179179
output.apiId = endpoint.apiId
180180
console.log(`Service with id ${output.apiId} updated.`)
181+
output.internalDomain = detail.internalDomain
181182
}
182183
} catch (e) {}
183184
}
@@ -190,14 +191,17 @@ class Apigw {
190191
output.apiId = apiId
191192
output.created = true
192193
console.log(`API with id ${output.apiId} created.`)
194+
195+
try {
196+
const { internalDomain } = await this.request({
197+
Action: 'DescribeApi',
198+
serviceId: serviceId,
199+
apiId: output.apiId
200+
})
201+
output.internalDomain = internalDomain
202+
} catch (e) {}
193203
}
194204

195-
const { internalDomain } = await this.request({
196-
Action: 'DescribeApi',
197-
serviceId: serviceId,
198-
apiId: output.apiId
199-
})
200-
output.internalDomain = internalDomain
201205
output.apiName = apiInputs.apiName
202206
return output
203207
}

0 commit comments

Comments
 (0)