Skip to content

fix: append UUID to URL path for item-specific API calls#2

Open
chris6785 wants to merge 1 commit into
Pixelworlds:masterfrom
chris6785:fix-uuid-url-path
Open

fix: append UUID to URL path for item-specific API calls#2
chris6785 wants to merge 1 commit into
Pixelworlds:masterfrom
chris6785:fix-uuid-url-path

Conversation

@chris6785

Copy link
Copy Markdown

Summary

  • Bug: callModularTool was passing the entire params object as a single argument to client methods that expect individual positional parameters (e.g., uuid, name, data)
  • Effect: Methods like aliasGetItem(uuid) received {uuid: "abc-123"} instead of the string "abc-123", producing URLs like /api/firewall/alias/get_item/[object Object] instead of /api/firewall/alias/get_item/abc-123
  • Fix: Parse function parameter names from toString() and map the params object values to positional arguments in the correct order

Test plan

  • Verified parameter name extraction works on compiled typescript-client output
  • Verified correct URL construction for: aliasGetItem, aliasSetItem, aliasToggleItem, aliasGetAliasUUID, filterMoveRuleBefore, categoryDelItem
  • Verified methods with no parameters still work correctly
  • Verified multi-parameter methods (e.g., filterMoveRuleBefore(selectedUuid, targetUuid, data)) map correctly

UUID parameters were not being appended to the URL path for methods
like getItem, setItem, delItem, causing API calls to fail.

The callModularTool method was passing the entire params object as a
single argument to client methods that expect individual positional
parameters. For example, aliasGetItem(uuid) received {uuid: "abc-123"}
instead of the string "abc-123", producing URLs like
/api/firewall/alias/get_item/[object Object].

Fix: Parse function parameter names from toString() and map the params
object values to positional arguments in the correct order.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant