Skip to content
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

fix(router): get middlewares route bug fixed #153

Merged
merged 1 commit into from
May 13, 2022
Merged

Conversation

sdimitris
Copy link
Contributor

Issue #152

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other (please describe)

Does this PR introduce a breaking change?

  • Yes
  • No

@kkopanidis kkopanidis merged commit 87351b5 into main May 13, 2022
@kkopanidis kkopanidis deleted the get_middlewares branch May 13, 2022 11:15
return { result: response }; // unnested from result in Rest.addConduitRoute, grpc routes avoid this using wrapRouterGrpcFunction
// @ts-ignore
let actualResponse = Array.from(new Set(response));
return { result: actualResponse }; // unnested from result in Rest.addConduitRoute, grpc routes avoid this using wrapRouterGrpcFunction
Copy link
Contributor

Choose a reason for hiding this comment

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

No need for a variable, return this directly.

const module = router.getGrpcRoutes();
Object.keys(module).forEach((url: string) => {
module[url].forEach((item: any) => {
if (item.returns == null && item.grpcFunction !== "") {
if (item.returns == null && !isNil(item.grpcFunction) && item.grpcFunction !== '') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need the !isNil() here? Null / Undefined don't match ''.

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.

None yet

3 participants