Skip to content

Commit 6cc2cb1

Browse files
Use bracket notation for document body keys (#1734)
Change assignments to the request body to use bracket notation (body['filename'], body['filter_id']) instead of dot notation. This ensures the string keys are set explicitly on the Record<string, string> and avoids relying on declared property names.
1 parent f51ac36 commit 6cc2cb1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sdks/typescript/src/documents.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ export class DocumentsClient {
166166
}
167167

168168
const body: Record<string, string> = {};
169-
if (opts.filename) body.filename = opts.filename;
170-
if (opts.filterId) body.filter_id = opts.filterId;
169+
if (opts.filename) body['filename'] = opts.filename;
170+
if (opts.filterId) body['filter_id'] = opts.filterId;
171171

172172
try {
173173
const response = await this.client._request("DELETE", "/api/v1/documents", {

0 commit comments

Comments
 (0)