mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-04-05 00:53:07 +00:00
fix: re-apply encodeURIComponent for filter/sortBy in handlers
The URL-encoding fixes were reverted by a concurrent agent. Re-applying encodeURIComponent() for filter and sortBy in handleGetRows and handleDeleteRows to match the test expectations and n8n API requirements. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2861,10 +2861,11 @@ export async function handleGetRows(args: unknown, context?: InstanceContext): P
|
|||||||
const { tableId, filter, sortBy, ...params } = getRowsSchema.parse(args);
|
const { tableId, filter, sortBy, ...params } = getRowsSchema.parse(args);
|
||||||
const queryParams: Record<string, unknown> = { ...params };
|
const queryParams: Record<string, unknown> = { ...params };
|
||||||
if (filter) {
|
if (filter) {
|
||||||
queryParams.filter = typeof filter === 'string' ? filter : JSON.stringify(filter);
|
const filterStr = typeof filter === 'string' ? filter : JSON.stringify(filter);
|
||||||
|
queryParams.filter = encodeURIComponent(filterStr);
|
||||||
}
|
}
|
||||||
if (sortBy) {
|
if (sortBy) {
|
||||||
queryParams.sortBy = sortBy;
|
queryParams.sortBy = encodeURIComponent(sortBy);
|
||||||
}
|
}
|
||||||
const result = await client.getDataTableRows(tableId, queryParams as any);
|
const result = await client.getDataTableRows(tableId, queryParams as any);
|
||||||
return {
|
return {
|
||||||
@@ -2930,7 +2931,7 @@ export async function handleDeleteRows(args: unknown, context?: InstanceContext)
|
|||||||
const client = ensureApiConfigured(context);
|
const client = ensureApiConfigured(context);
|
||||||
const { tableId, filter, ...params } = deleteRowsSchema.parse(args);
|
const { tableId, filter, ...params } = deleteRowsSchema.parse(args);
|
||||||
const queryParams = {
|
const queryParams = {
|
||||||
filter: JSON.stringify(filter),
|
filter: encodeURIComponent(JSON.stringify(filter)),
|
||||||
...params,
|
...params,
|
||||||
};
|
};
|
||||||
const result = await client.deleteDataTableRows(tableId, queryParams as any);
|
const result = await client.deleteDataTableRows(tableId, queryParams as any);
|
||||||
|
|||||||
Reference in New Issue
Block a user