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

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

Open
DevFreezing opened this issue Oct 24, 2024 · 2 comments
Open

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

DevFreezing opened this issue Oct 24, 2024 · 2 comments

Comments

@DevFreezing
Copy link

DevFreezing commented Oct 24, 2024

It seems that the new version (v2.0.0) of Mealie has introduced changes to the shopping list API, which causes it to no longer work with Mealient. As a result, shopping lists are not functioning as expected.

Here’s the error I’m encountering:
imagen

@DevFreezing DevFreezing changed the title Mealie v2.0.0 shopping list does not work Mealie v2.0.0 Shopping List API Not Working with Mealient Oct 24, 2024
@Hyperion923
Copy link

Hyperion923 commented Oct 31, 2024

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`)

there are only some changes in the MealiServiceKtor i have changed this already:

Subject: [PATCH] fixing the endpoints for the shopping list at ServerVersion V2.1.0 to new API endpoints

Index: datasource/src/main/kotlin/gq/kirmanak/mealient/datasource/impl/MealieServiceKtor.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8

diff --git a/datasource/src/main/kotlin/gq/kirmanak/mealient/datasource/impl/MealieServiceKtor.kt b/datasource/src/main/kotlin/gq/kirmanak/mealient/datasource/impl/MealieServiceKtor.kt
--- a/datasource/src/main/kotlin/gq/kirmanak/mealient/datasource/impl/MealieServiceKtor.kt (revision fd39b7e)
+++ b/datasource/src/main/kotlin/gq/kirmanak/mealient/datasource/impl/MealieServiceKtor.kt (revision 8c864cb)
@@ -140,7 +140,7 @@

 override suspend fun getShoppingLists(page: Int, perPage: Int): GetShoppingListsResponse {
     return httpClient.get {
  •        endpoint("/api/groups/shopping/lists") {
    
  •        endpoint("/api/households/shopping/lists") {
               parameters.append("page", page.toString())
               parameters.append("perPage", perPage.toString())
           }
    

@@ -149,19 +149,19 @@

 override suspend fun getShoppingList(id: String): GetShoppingListResponse {
     return httpClient.get {
  •        endpoint("/api/groups/shopping/lists/$id")
    
  •        endpoint("/api/households/shopping/lists/$id")
       }.body()
    

    }

    override suspend fun getShoppingListItem(id: String): JsonElement {
    return httpClient.get {

  •        endpoint("/api/groups/shopping/items/$id")
    
  •        endpoint("/api/households/shopping/items/$id")
       }.body()
    

    }

    override suspend fun updateShoppingListItem(id: String, request: JsonElement) {
    httpClient.put {

  •        endpoint("/api/groups/shopping/items/$id")
    
  •        endpoint("/api/households/shopping/items/$id")
           contentType(ContentType.Application.Json)
           setBody(request)
       }
    

@@ -169,7 +169,7 @@

 override suspend fun deleteShoppingListItem(id: String) {
     httpClient.delete {
  •        endpoint("/api/groups/shopping/items/$id")
    
  •        endpoint("/api/households/shopping/items/$id")
       }
    
    }

@@ -191,7 +191,7 @@

 override suspend fun createShoppingListItem(request: CreateShoppingListItemRequest) {
     httpClient.post {
  •        endpoint("/api/groups/shopping/items")
    
  •        endpoint("/api/households/shopping/items")
           contentType(ContentType.Application.Json)
           setBody(request)
       }
    

@@ -199,7 +199,7 @@

 override suspend fun createShoppingList(request: CreateShoppingListRequest) {
     httpClient.post {
  •        endpoint("/api/groups/shopping/lists")
    
  •        endpoint("/api/households/shopping/lists")
           contentType(ContentType.Application.Json)
           setBody(request)
       }
    

@@ -207,13 +207,13 @@

 override suspend fun deleteShoppingList(id: String) {
     httpClient.delete {
  •        endpoint("/api/groups/shopping/lists/$id")
    
  •        endpoint("/api/households/shopping/lists/$id")
       }
    

    }

    override suspend fun updateShoppingList(id: String, request: JsonElement) {
    httpClient.put {

  •        endpoint("/api/groups/shopping/lists/$id")
    
  •        endpoint("/api/households/shopping/lists/$id")
           contentType(ContentType.Application.Json)
           setBody(request)
       }
    

@@ -221,7 +221,7 @@

 override suspend fun getShoppingListJson(id: String): JsonElement {
     return httpClient.get {
  •        endpoint("/api/groups/shopping/lists/$id")
    
  •        endpoint("/api/households/shopping/lists/$id")
       }.body()
    
    }

@Hyperion923
Copy link

#338

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