Skip to content

Commit fa5c6b9

Browse files
committed
updated get app list to be an array
1 parent a669d76 commit fa5c6b9

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.changeset/beige-seas-reflect.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"cloudways-js-client": patch
3+
---
4+
5+
updated get app list to be an array

src/services/Lists/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,16 @@ import type {
3636
* ```
3737
*/
3838
export function getAppList(): Promise<AppInfo[]> {
39-
return apiCall("/apps");
39+
return apiCall("/apps").then((response) => {
40+
const appList: AppInfo[] = [];
41+
for (const app in response.apps) {
42+
appList.push({
43+
label: app,
44+
versions: response.apps[app],
45+
});
46+
}
47+
return appList;
48+
});
4049
}
4150

4251
/**

0 commit comments

Comments
 (0)