File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ class Apigw {
146
146
console . debug ( `Updating api with api id ${ endpoint . apiId } .` )
147
147
await this . request ( {
148
148
Action : 'ModifyApi' ,
149
- apiId : endpoint . appId ,
149
+ apiId : endpoint . apiId ,
150
150
...apiInputs
151
151
} )
152
152
output . apiId = endpoint . apiId
@@ -331,16 +331,20 @@ class Apigw {
331
331
const { endpoints } = inputs
332
332
for ( let i = 0 , len = endpoints . length ; i < len ; i ++ ) {
333
333
const endpoint = endpoints [ i ]
334
- const curApi = await this . createOrUpdateApi ( {
335
- serviceId,
336
- endpoint
337
- } )
338
334
// if exist in state list, set created to be true
339
- const exists = stateApiList . filter (
335
+ const [ exist ] = stateApiList . filter (
340
336
( item ) =>
341
337
item . method . toLowerCase ( ) === endpoint . method . toLowerCase ( ) && item . path === endpoint . path
342
338
)
343
- if ( exists && exists . length > 0 ) {
339
+
340
+ if ( exist ) {
341
+ endpoint . apiId = exist . apiId
342
+ }
343
+ const curApi = await this . createOrUpdateApi ( {
344
+ serviceId,
345
+ endpoint
346
+ } )
347
+ if ( exist ) {
344
348
curApi . created = true
345
349
}
346
350
You can’t perform that action at this time.
0 commit comments