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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ internal class MealieServiceKtor @Inject constructor(

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())
}
Expand All @@ -149,27 +149,27 @@ internal class MealieServiceKtor @Inject constructor(

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

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

Expand All @@ -191,37 +191,37 @@ internal class MealieServiceKtor @Inject constructor(

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

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

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

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

Expand Down