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 {
146146 console . debug ( `Updating api with api id ${ endpoint . apiId } .` )
147147 await this . request ( {
148148 Action : 'ModifyApi' ,
149- apiId : endpoint . appId ,
149+ apiId : endpoint . apiId ,
150150 ...apiInputs
151151 } )
152152 output . apiId = endpoint . apiId
@@ -331,16 +331,20 @@ class Apigw {
331331 const { endpoints } = inputs
332332 for ( let i = 0 , len = endpoints . length ; i < len ; i ++ ) {
333333 const endpoint = endpoints [ i ]
334- const curApi = await this . createOrUpdateApi ( {
335- serviceId,
336- endpoint
337- } )
338334 // if exist in state list, set created to be true
339- const exists = stateApiList . filter (
335+ const [ exist ] = stateApiList . filter (
340336 ( item ) =>
341337 item . method . toLowerCase ( ) === endpoint . method . toLowerCase ( ) && item . path === endpoint . path
342338 )
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 ) {
344348 curApi . created = true
345349 }
346350
You can’t perform that action at this time.
0 commit comments