Skip to content

Commit

Permalink
Fix [UI] Can't create more than 1 gateway per function (#1574)
Browse files Browse the repository at this point in the history
  • Loading branch information
illia-prokopchuk authored Aug 21, 2024
1 parent 9f2183d commit f6056c2
Showing 1 changed file with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,15 +305,9 @@ such restriction.
suggestionsList = lodash.chain(functionsList)
.filter(function (aFunction) {
var functionName = lodash.get(aFunction, 'metadata.name');
var functionApiGateways = lodash.chain(aFunction)
.get('status.apiGateways', []) // get the function's list of related API GWs
.without(ctrl.apiGateway.spec.name) // remove current API GW name from list
.value();
var functionAlreadyUsedInThisApiGateway = lodash.includes(upstreamsFunctionNames, functionName);
var functionAlreadyUsedInAnotherApiGateway = !lodash.isEmpty(functionApiGateways);

return !functionAlreadyUsedInThisApiGateway &&
!functionAlreadyUsedInAnotherApiGateway &&
(lodash.isEmpty(lodash.trim(newData)) || lodash.includes(functionName, newData));
})
.map(function (aFunction) {
Expand Down

0 comments on commit f6056c2

Please sign in to comment.