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

Mealie v2.0.0 Shopping List API Not Working with Mealient #335 #338

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Hyperion923
Copy link

The endpoints for interacting with shopping lists have changed in Mealie. This may cause issues for users who have integrated with the Mealie API, particularly those using the shopping list functionality.

Previous Endpoints:
Example of an old endpoint: /api/groups/shopping/lists
New Endpoints:
Example of an new endpoint: /api/households/shopping/lists

Copy link

sweep-ai bot commented Oct 31, 2024

Hey @Hyperion923, here is an example of how you can ask me to improve this pull request:

@Sweep Add unit tests for `MealieServiceKtor` that verify the correct API endpoints are being called with the new "/api/households/shopping/" prefix instead of "/api/groups/shopping/". This should include tests for all modified methods:
- getShoppingLists()
- getShoppingList()
- getShoppingListItem()
- updateShoppingListItem()
- deleteShoppingListItem()
- createShoppingListItem()
- createShoppingList()
- deleteShoppingList()
- updateShoppingList()
- getShoppingListJson()

📖 For more information on how to use Sweep, please read our documentation.

@HowRuck
Copy link
Contributor

HowRuck commented Nov 3, 2024

This already looks good to me :D

But this PR would break the app for users still running mealie 1.x. I think a better approach would be to dynamically select the required endpoint based on the version of the mealie instance mealient is connected to.

This can be done pretty easily as the version number is included in the /api/app/about endpoint (https://docs.mealie.io/api/redoc/#tag/App:-About).
This endpoint is also already used in the tryBaseURL function, and we should be able to relatively easy extract the version number from here and use it to dynamically use the correct endpoint based on the version of the connected mealie instance.

What do you think about this? :-)

I've already implemented this in my own fork HowRuck/Mealient@858e664 (unit tests and some polish still missing), but I am still working on another PR/feature that I want to complete before "pull requesting" upstream, which is why I haven't done so already. Feel free to use this code as a starting point if we decide to go that route :-)

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.

2 participants