Skip to content
This repository has been archived by the owner on Mar 21, 2021. It is now read-only.

Add filtering query method to Vue client-code entity services. #568

Open
1 task done
kevinbwusa opened this issue Feb 29, 2020 · 1 comment
Open
1 task done

Add filtering query method to Vue client-code entity services. #568

kevinbwusa opened this issue Feb 29, 2020 · 1 comment

Comments

@kevinbwusa
Copy link

kevinbwusa commented Feb 29, 2020

Overview of the feature request

Allow Vue front-end client services to use query parameters like Angular does.

Motivation for or Use Case

This feature is important to me because I need a light-weight entity filtering capability that is available to front-end Vue clients and I don't want to use Elastic Search.

Related issues or PR

N/A

  • Checking this box is mandatory (this is just to show you read everything)

I have implemented a solution here: https://github.com/kevinbwusa/jhipster-vuejs and I will now submit a pull request to have it merged.

@stonedMoose
Copy link

Hi @kevinbwusa, what you suggest could be a good idea.

I took a look on the solution you implemented, and I have some suggestion:

  • you should type the queryParams of your buildQueryParamsmethod. This way you can get rid of the Array type check.
  • Instead of using the for loop over the params, I think you could simply do it like this:
buildQueryParams(queryParams: string[]) {
  return queryParams.join('&')
}
  • I'm not convinced that the test you suggest test what you implemented. For me it checks that given a mocked return value from a service. When I call the mocked method of that service, it return the mocked return value. But I might misreading your test.
  • You should write unit test for your buildQueryParams function.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants