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

Additional Interface Cleanup #1147

Open
korgon opened this issue Sep 3, 2024 · 0 comments · Fixed by #1160
Open

Additional Interface Cleanup #1147

korgon opened this issue Sep 3, 2024 · 0 comments · Fixed by #1160
Assignees
Labels
type: refactor Code cleanup
Milestone

Comments

@korgon
Copy link
Contributor

korgon commented Sep 3, 2024

With the move to 1.0 we need to ensure our external interfaces are in a good state. Some interfaces that could use work are listed below and they are all pretty related; there may be more interfaces that could use adjusting.

Client

The autocomplete, search, finder and recommend methods return multiple API results, but they do it differently - we should be consistent with the response format. I am leaning more towards returning an object with the different response data but we could stick with the Promise.all array format as well - either way consistency is important here.

// possible `search` return obj
{
  search: SearchResponse,
  meta: MetaResponse
}

// possible `recommend` return obj
{
  recommend: SearchResponse,
  meta: MetaResponse
  profile: ProfileResponse
}

MockClient

Changes to the Client above would necessitate changes to the Mock for it.

MockData

Similarly to the MockClient changes to MockData would be necessary, as currently the meta response is added into the API response - we would want to clean this up.

Controller search methods

Changes to all of the above would necessitate changes to the controller search methods as well as the associated store update methods; these would need to be refactored to separate out multiple API responses instead of merging them.

@korgon korgon added the type: refactor Code cleanup label Sep 3, 2024
@korgon korgon added this to the 1.0 milestone Sep 3, 2024
@dkonieczek dkonieczek self-assigned this Sep 3, 2024
@dkonieczek dkonieczek linked a pull request Sep 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: refactor Code cleanup
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants