Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Add search functionality #44

Merged
merged 5 commits into from
Sep 27, 2021
Merged

Add search functionality #44

merged 5 commits into from
Sep 27, 2021

Conversation

Erik142
Copy link
Contributor

@Erik142 Erik142 commented Sep 10, 2021

Closes #43

These changes implement search functionality for the IKEA product catalog by product name. Search is accessed through a property within the IkeaApi class. The implementation is kept in a separate class within "endpoints".

One minor change has been made to the API class to accomodate API requests without a Bearer token, since the search API doesn't use one.

Tested using the Swedish API, it works fine for me. Let me know if any further changes are required from my end.

Thanks!

There is no way to assign a string with value None in python, use empty string to check whether or not a token should be set.
The Search class is used to search the IKEA product catalog by product name
Update README.md with a description on how to use the product search functionality
@Erik142
Copy link
Contributor Author

Erik142 commented Sep 10, 2021

I realised that I forgot to update the readme. I will update it ASAP and commit. Sorry about that!

@vrslev
Copy link
Owner

vrslev commented Sep 18, 2021

Sorry for delay, I will look into this as soon as I can.

src/ikea_api/api.py Outdated Show resolved Hide resolved
src/ikea_api/endpoints/search/__init__.py Outdated Show resolved Hide resolved
src/ikea_api/endpoints/search/__init__.py Outdated Show resolved Hide resolved
src/ikea_api/endpoints/search/__init__.py Outdated Show resolved Hide resolved
@vrslev
Copy link
Owner

vrslev commented Sep 19, 2021

I will make changes myself.

- Drop `_search` function
- Fix "" and None token values
- Add types param
- Rename `amount` param to `limit`
- Return full response
- Add typing_extensions to deps
@vrslev
Copy link
Owner

vrslev commented Sep 19, 2021

Just added commit. Does it looks good to you?

@vrslev vrslev requested review from vrslev and removed request for vrslev September 20, 2021 06:04
@vrslev vrslev merged commit c30e3a7 into vrslev:main Sep 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature suggestion: Search for products by name
2 participants