feat: transform ViaSocket fields structure for new payload format#792
Merged
Natwar589 merged 3 commits intoWalkover-Web-Solution:testingfrom Mar 5, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Other comments (2)
-
src/services/utils/helper.utils.js (154-154)
This complex ternary operation is hard to read and maintain. Consider refactoring to a more explicit approach:
required_params: (() => { if (Array.isArray(value.required_params)) return value.required_params; if (Array.isArray(value.required)) return value.required; return []; })(), -
src/controllers/apiCall.controller.js (67-71)
There are commented out lines of code that should be removed rather than left in the codebase. This creates technical debt and confusion for future developers.
const body_content = payload ? payload.body : null; let fields = body_content?.fields;
💡 To request another review, post a new comment with "/windsurf-review".
Contributor
There was a problem hiding this comment.
Other comments (2)
- src/controllers/apiCall.controller.js (68-71) Consider removing these commented-out lines since they're no longer needed with the new implementation. Keeping old code commented makes the codebase harder to maintain.
-
src/services/utils/helper.utils.js (161-161)
This nested ternary operation is a bit complex and could be simplified for better readability:
required_params: Array.isArray(value.required_params) ? value.required_params : (Array.isArray(value.required) ? value.required : []),
💡 To request another review, post a new comment with "/windsurf-review".
Natwar589
approved these changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates the ViaSocket API call flow to handle the new payload format where fields are directly available under payload.body.fields instead of being traversed.