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
Issue: SearchCompanyAsync method does not encorporate restrictions query parameter #203
Comments
@kevbite also your test cases are not buildable as the .net framework on project CompaniesHouse is 4.5 and on test case project ir is .net 7. When i updated the project's targeting framwork to build test cases. They are already failing. Please check this at your own end, I could currently provide a fix but please merge them on priority |
The tests should still run locally, just ran them on GitHub and I don't think it has access to the key because it's a fork. However, the code you've changed applies restrictions to all search endpoints when it's only applicable to searching companies, I'd be good if the types matched what the api accepts. Also, it seems that restrictions is also an enumeration that is delimited with a space. |
@arucodes do you know where the enumations values are for this query string? I can't find them anywhere on their documentation except for the 2 examples. |
@kevbite there is a bug in #204 It should be if (!string.IsNullOrWhiteSpace(request.Restrictions))
{
query += "&restrictions=" + request.Restrictions;
} instead of if (string.IsNullOrWhiteSpace(request.Restrictions))
{
query += "&restrictions=" + request.Restrictions;
} 0c113ac#diff-d09858bb2ecfeec999c19b1adc9557375b62d6e4000ec3df1358bd8bc5d407d0R30 I fixed this bug and did a minor refactoring of the SearchUriBuilder and SearchCompanyUriBuilder classes. Please take a look at my PR #208 |
Hey, sorry taken a while, but I've merged in these changes, they'll be in the latest nuget package. |
Hi Kev,
I was working on consuming this SearchCompanyAsync method for searching companies, however I needed to search for companies that are not having dissolved status, and the companiesHouse provides a query parameter for this as "restrictions". Which helps enhance the search.
Reference:
Without using this parameter suppose I developed an API to consume this method and searched for companies ( using SearchCompanyAsync ) with items_per_page as 10 and received 2 companies as dissolved, it affects my pagination, now I have to give response back with 8 items while the pagination was having 10 items per page for the UI, it looks bad.
Please check.
The text was updated successfully, but these errors were encountered: