Skip to content

Commit b819e5f

Browse files
committed
refactor(gateway): use policy swap class for deletes
1 parent e9a50a2 commit b819e5f

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

src/core/gateway.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,10 @@ export class GatewayClient implements CoreGatewayClient {
261261
if (!role) return response;
262262

263263
const configurations = await listTargetRoleConfigurations(control, gatewayId, targetId);
264-
return swapInlinePolicyForOperation(
265-
iam,
266-
{
267-
roleName: role.roleName,
268-
policyNamePrefix: GATEWAY_EXECUTION_POLICY_NAME,
269-
policyDocument: role.candidatePolicyDocument(configurations),
270-
},
271-
async () => response,
272-
);
264+
return new InlinePolicySwap(iam, {
265+
roleName: role.roleName,
266+
policyNamePrefix: GATEWAY_EXECUTION_POLICY_NAME,
267+
}).run(role.candidatePolicyDocument(configurations), async () => response);
273268
}
274269

275270
async getGatewayRule(

0 commit comments

Comments
 (0)