Skip to content

💪 Update RestfulApiRoutesBuilder#generateRendererHandler() with ResponseFlusher structure #385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

@StewEucen StewEucen requested review from hecticme, a team and Copilot April 25, 2025 11:54
@StewEucen StewEucen self-assigned this Apr 25, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the RestfulApiRoutesBuilder to use the ResponseFlusher structure, ensuring that the renderer’s flushResponse method is invoked instead of the builder’s. Key changes include:

  • Updating the test suite to spy on renderer.flushResponse rather than builder.flushResponse.
  • Renaming the parameter key from response to renderResponse to be consistent throughout.
  • Adding a new “set” method in the test stub to support chainable assertions.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/tests/server/restfulapi/RestfulApiRoutesBuilder.js Updated test descriptions and flushResponse spy to reference renderer, along with a new set() method in the stub.
lib/server/restfulapi/RestfulApiRoutesBuilder.js Changed flushResponse call to use renderer.flushResponse with an updated parameter key.
Comments suppressed due to low confidence (1)

tests/tests/server/restfulapi/RestfulApiRoutesBuilder.js:608

  • [nitpick] The addition of the 'set' method in the test stub is very generic and may lead to confusion with JavaScript's built-in setter syntax. Consider renaming it to something more descriptive or adding a comment explaining its purpose.
+        set () {

@StewEucen StewEucen marked this pull request as ready for review April 25, 2025 11:55
Copy link

@EG-easy EG-easy left a comment

Choose a reason for hiding this comment

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

🍵

@StewEucen StewEucen merged commit a23cbfb into retake/RESTful-API-flushing-structure Apr 25, 2025
2 checks passed
@StewEucen StewEucen deleted the update/generateRendererHandler-of-RestfulApiRoutesBuilder branch April 25, 2025 11:57
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