Skip to content

Commit 7339efb

Browse files
Vikram KaltaVikram Kalta
authored andcommitted
fix: resolved sdk method undefined issue
1 parent ed092e7 commit 7339efb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/util/common-utils.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ function uninstallApp(flags: FlagInput, orgUid: string, options: CommonOptions,
180180
}
181181

182182
async function fetchInstalledApps(flags: FlagInput, orgUid: string, options: CommonOptions) {
183-
const { log } = options;
183+
const { managementSdk, log } = options;
184184
const apps = (await fetchApps(flags, orgUid, options)) || [];
185185
let batchRequests = [];
186186
// Make calls in batch. 10 requests per batch allowed.
@@ -191,7 +191,11 @@ async function fetchInstalledApps(flags: FlagInput, orgUid: string, options: Com
191191
for (const batch of batchRequests) {
192192
const promises = batch.map(async (app) => {
193193
try {
194-
const installations = await app.listInstallations();
194+
const installations = await managementSdk
195+
.organization(orgUid)
196+
.app(app.uid)
197+
.installation()
198+
.findAll();
195199
return installations.items.length ? installations.items : null;
196200
}
197201
catch (error) {

0 commit comments

Comments
 (0)