Skip to content

feat: transform ViaSocket fields structure for new payload format#792

Merged
Natwar589 merged 3 commits intoWalkover-Web-Solution:testingfrom
Anushtha-Rathore:viasocketToolFieldTransform
Mar 5, 2026
Merged

feat: transform ViaSocket fields structure for new payload format#792
Natwar589 merged 3 commits intoWalkover-Web-Solution:testingfrom
Anushtha-Rathore:viasocketToolFieldTransform

Conversation

@Anushtha-Rathore
Copy link
Contributor

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.

Copy link
Contributor

@windsurf-bot windsurf-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".

Copy link
Contributor

@windsurf-bot windsurf-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Natwar589 merged commit 3b359a4 into Walkover-Web-Solution:testing Mar 5, 2026
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.

2 participants