Skip to content

Commit 51d6220

Browse files
committed
Schema changes
1 parent b0b1898 commit 51d6220

File tree

2 files changed

+205
-216
lines changed

2 files changed

+205
-216
lines changed

packages/infra/src/utils.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,21 @@ export async function getApiManager(): Promise<APIManagerBase> {
4545
* Call the management API
4646
*/
4747
export async function callManagementApi(
48-
method: string = 'POST',
49-
uri: string = '',
50-
params: Record<string, any> = {}
51-
): Promise<Record<string, any>> {
48+
method: string = "POST",
49+
uri: string = "",
50+
kwargs: Record<string, any> = {}
51+
): Promise<any> {
5252
const s1cManager = await getApiManager();
5353
const data: Record<string, any> = {};
5454

55-
// Convert snake_case to kebab-case for API parameters
56-
for (const [key, value] of Object.entries(params)) {
57-
if (value === null || value === '') {
55+
for (const [key, value] of Object.entries(kwargs)) {
56+
// Skip null, undefined, empty strings, and empty arrays
57+
if (value === null || value === undefined || value === "" ||
58+
(Array.isArray(value) && value.length === 0)) {
5859
continue;
5960
}
60-
const safeKey = key.replace(/_/g, '-');
61+
62+
const safeKey = key.replace(/_/g, "-");
6163
data[safeKey] = value;
6264
}
6365

0 commit comments

Comments
 (0)