diff --git a/src/pipes/pipes.spec.ts b/src/pipes/pipes.spec.ts index 944e58bfd..bc8d96c93 100644 --- a/src/pipes/pipes.spec.ts +++ b/src/pipes/pipes.spec.ts @@ -308,6 +308,10 @@ describe('Pipes', () => { expect(new URL(String(fetchURL())).pathname).toBe( '/user_management/users/test_userId/connected_accounts/test_slug', ); + expect(fetchSearchParams()).toEqual({ + organization_id: 'org_01EHZNVPK3SFK441A1RGBFSHRT', + }); + expect(fetchSearchParams()).not.toHaveProperty('query'); }); }); diff --git a/src/pipes/pipes.ts b/src/pipes/pipes.ts index dccd265e7..eeadae230 100644 --- a/src/pipes/pipes.ts +++ b/src/pipes/pipes.ts @@ -477,11 +477,9 @@ export class Pipes { await this.workos.delete( `/user_management/users/${encodeURIComponent(userId)}/connected_accounts/${encodeURIComponent(slug)}`, { - query: { - ...(options.organizationId !== undefined && { - organization_id: options.organizationId, - }), - }, + ...(options.organizationId !== undefined && { + organization_id: options.organizationId, + }), }, ); } diff --git a/src/vault/vault.spec.ts b/src/vault/vault.spec.ts index 9c7fac444..8903e7200 100644 --- a/src/vault/vault.spec.ts +++ b/src/vault/vault.spec.ts @@ -201,6 +201,10 @@ describe('Vault', () => { expect(fetchMethod()).toBe('DELETE'); expect(new URL(String(fetchURL())).pathname).toBe('/vault/v1/kv/test_id'); + expect(fetchSearchParams()).toEqual({ + version_check: 'test_version_check', + }); + expect(fetchSearchParams()).not.toHaveProperty('query'); }); }); diff --git a/src/vault/vault.ts b/src/vault/vault.ts index dafc1eae9..0c0da6d9e 100644 --- a/src/vault/vault.ts +++ b/src/vault/vault.ts @@ -305,11 +305,9 @@ export class Vault { async deleteObject(options: DeleteVaultObjectOptions): Promise { const { id } = options; await this.workos.delete(`/vault/v1/kv/${encodeURIComponent(id)}`, { - query: { - ...(options.versionCheck !== undefined && { - version_check: options.versionCheck, - }), - }, + ...(options.versionCheck !== undefined && { + version_check: options.versionCheck, + }), }); } diff --git a/src/workos.ts b/src/workos.ts index 82ce3ba30..6f5c12bb8 100644 --- a/src/workos.ts +++ b/src/workos.ts @@ -358,7 +358,10 @@ export class WorkOS { return { data: await res.toJSON() }; } - async delete(path: string, query?: any): Promise { + async delete( + path: string, + query?: Record, + ): Promise { this.requireApiKey(path); try {