Fixed Shopping List API paths for compatibility with Mealie 2.0
This commit is contained in:
@@ -140,7 +140,7 @@ internal class MealieServiceKtor @Inject constructor(
|
|||||||
|
|
||||||
override suspend fun getShoppingLists(page: Int, perPage: Int): GetShoppingListsResponse {
|
override suspend fun getShoppingLists(page: Int, perPage: Int): GetShoppingListsResponse {
|
||||||
return httpClient.get {
|
return httpClient.get {
|
||||||
endpoint("/api/groups/shopping/lists") {
|
endpoint("/api/households/shopping/lists") {
|
||||||
parameters.append("page", page.toString())
|
parameters.append("page", page.toString())
|
||||||
parameters.append("perPage", perPage.toString())
|
parameters.append("perPage", perPage.toString())
|
||||||
}
|
}
|
||||||
@@ -149,19 +149,19 @@ internal class MealieServiceKtor @Inject constructor(
|
|||||||
|
|
||||||
override suspend fun getShoppingList(id: String): GetShoppingListResponse {
|
override suspend fun getShoppingList(id: String): GetShoppingListResponse {
|
||||||
return httpClient.get {
|
return httpClient.get {
|
||||||
endpoint("/api/groups/shopping/lists/$id")
|
endpoint("/api/households/shopping/lists/$id")
|
||||||
}.body()
|
}.body()
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun getShoppingListItem(id: String): JsonElement {
|
override suspend fun getShoppingListItem(id: String): JsonElement {
|
||||||
return httpClient.get {
|
return httpClient.get {
|
||||||
endpoint("/api/groups/shopping/items/$id")
|
endpoint("/api/households/shopping/items/$id")
|
||||||
}.body()
|
}.body()
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun updateShoppingListItem(id: String, request: JsonElement) {
|
override suspend fun updateShoppingListItem(id: String, request: JsonElement) {
|
||||||
httpClient.put {
|
httpClient.put {
|
||||||
endpoint("/api/groups/shopping/items/$id")
|
endpoint("/api/households/shopping/items/$id")
|
||||||
contentType(ContentType.Application.Json)
|
contentType(ContentType.Application.Json)
|
||||||
setBody(request)
|
setBody(request)
|
||||||
}
|
}
|
||||||
@@ -169,7 +169,7 @@ internal class MealieServiceKtor @Inject constructor(
|
|||||||
|
|
||||||
override suspend fun deleteShoppingListItem(id: String) {
|
override suspend fun deleteShoppingListItem(id: String) {
|
||||||
httpClient.delete {
|
httpClient.delete {
|
||||||
endpoint("/api/groups/shopping/items/$id")
|
endpoint("/api/households/shopping/items/$id")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,7 +191,7 @@ internal class MealieServiceKtor @Inject constructor(
|
|||||||
|
|
||||||
override suspend fun createShoppingListItem(request: CreateShoppingListItemRequest) {
|
override suspend fun createShoppingListItem(request: CreateShoppingListItemRequest) {
|
||||||
httpClient.post {
|
httpClient.post {
|
||||||
endpoint("/api/groups/shopping/items")
|
endpoint("/api/households/shopping/items")
|
||||||
contentType(ContentType.Application.Json)
|
contentType(ContentType.Application.Json)
|
||||||
setBody(request)
|
setBody(request)
|
||||||
}
|
}
|
||||||
@@ -199,7 +199,7 @@ internal class MealieServiceKtor @Inject constructor(
|
|||||||
|
|
||||||
override suspend fun createShoppingList(request: CreateShoppingListRequest) {
|
override suspend fun createShoppingList(request: CreateShoppingListRequest) {
|
||||||
httpClient.post {
|
httpClient.post {
|
||||||
endpoint("/api/groups/shopping/lists")
|
endpoint("/api/households/shopping/lists")
|
||||||
contentType(ContentType.Application.Json)
|
contentType(ContentType.Application.Json)
|
||||||
setBody(request)
|
setBody(request)
|
||||||
}
|
}
|
||||||
@@ -207,13 +207,13 @@ internal class MealieServiceKtor @Inject constructor(
|
|||||||
|
|
||||||
override suspend fun deleteShoppingList(id: String) {
|
override suspend fun deleteShoppingList(id: String) {
|
||||||
httpClient.delete {
|
httpClient.delete {
|
||||||
endpoint("/api/groups/shopping/lists/$id")
|
endpoint("/api/households/shopping/lists/$id")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun updateShoppingList(id: String, request: JsonElement) {
|
override suspend fun updateShoppingList(id: String, request: JsonElement) {
|
||||||
httpClient.put {
|
httpClient.put {
|
||||||
endpoint("/api/groups/shopping/lists/$id")
|
endpoint("/api/households/shopping/lists/$id")
|
||||||
contentType(ContentType.Application.Json)
|
contentType(ContentType.Application.Json)
|
||||||
setBody(request)
|
setBody(request)
|
||||||
}
|
}
|
||||||
@@ -221,7 +221,7 @@ internal class MealieServiceKtor @Inject constructor(
|
|||||||
|
|
||||||
override suspend fun getShoppingListJson(id: String): JsonElement {
|
override suspend fun getShoppingListJson(id: String): JsonElement {
|
||||||
return httpClient.get {
|
return httpClient.get {
|
||||||
endpoint("/api/groups/shopping/lists/$id")
|
endpoint("/api/households/shopping/lists/$id")
|
||||||
}.body()
|
}.body()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user