diff --git a/app/app/src/main/java/tech/mercantec/easyeat/helpers/auth.kt b/app/app/src/main/java/tech/mercantec/easyeat/helpers/auth.kt index bb8cdce..5362641 100644 --- a/app/app/src/main/java/tech/mercantec/easyeat/helpers/auth.kt +++ b/app/app/src/main/java/tech/mercantec/easyeat/helpers/auth.kt @@ -124,5 +124,5 @@ data class ShoppingListAddRecipeRequest(val id: Int, val multiplier: Int) fun AddRecipeToShoppingList(ctx: Context, id: Int, multiplier: Int) { val request = ShoppingListAddRecipeRequest(id, multiplier) - return requestJson(ctx, "ADD", "/api/ShoppingList/recipeadd", request) + return requestJson(ctx, "POST", "/api/ShoppingList/recipeadd", request) } diff --git a/app/app/src/main/java/tech/mercantec/easyeat/helpers/dishes.kt b/app/app/src/main/java/tech/mercantec/easyeat/helpers/dishes.kt index 146e876..bcaba3a 100644 --- a/app/app/src/main/java/tech/mercantec/easyeat/helpers/dishes.kt +++ b/app/app/src/main/java/tech/mercantec/easyeat/helpers/dishes.kt @@ -19,7 +19,7 @@ fun createRecipe(ctx: Context, recipe: Recipe) { @Serializable data class GetAllRecipesResponse(val id: Int, val name: String, val description: String) -fun getAllRecipies(ctx: Context): List { +fun getAllRecipes(ctx: Context): List { return requestJson>(ctx, "GET", "/api/Recipe/getall", null) } diff --git a/app/app/src/main/java/tech/mercantec/easyeat/ui/dishes/CreateDishActivity.kt b/app/app/src/main/java/tech/mercantec/easyeat/ui/dishes/CreateDishActivity.kt index 7743358..b5cf99f 100644 --- a/app/app/src/main/java/tech/mercantec/easyeat/ui/dishes/CreateDishActivity.kt +++ b/app/app/src/main/java/tech/mercantec/easyeat/ui/dishes/CreateDishActivity.kt @@ -15,9 +15,6 @@ import androidx.appcompat.app.AppCompatActivity import tech.mercantec.easyeat.R import tech.mercantec.easyeat.helpers.ApiRequestException import tech.mercantec.easyeat.helpers.createRecipe -import tech.mercantec.easyeat.helpers.request -import tech.mercantec.easyeat.models.CreateIngredient -import tech.mercantec.easyeat.models.CreateRecipe import tech.mercantec.easyeat.models.Ingredient import tech.mercantec.easyeat.models.Recipe import kotlin.concurrent.thread diff --git a/app/app/src/main/java/tech/mercantec/easyeat/ui/dishes/DishDetailsActivity.kt b/app/app/src/main/java/tech/mercantec/easyeat/ui/dishes/DishDetailsActivity.kt index 5c5f1f6..bfa9630 100644 --- a/app/app/src/main/java/tech/mercantec/easyeat/ui/dishes/DishDetailsActivity.kt +++ b/app/app/src/main/java/tech/mercantec/easyeat/ui/dishes/DishDetailsActivity.kt @@ -112,7 +112,7 @@ class DishDetailsActivity : AppCompatActivity() { // You can do the same for directions if needed } - val saveButton: Button = findViewById(R.id.saveDishButton) + val saveButton: Button = findViewById(R.id.addDishToShoppingList) saveButton.setOnClickListener { diff --git a/app/app/src/main/java/tech/mercantec/easyeat/ui/dishes/DishesFragment.kt b/app/app/src/main/java/tech/mercantec/easyeat/ui/dishes/DishesFragment.kt index 70ab3fd..b80f99a 100644 --- a/app/app/src/main/java/tech/mercantec/easyeat/ui/dishes/DishesFragment.kt +++ b/app/app/src/main/java/tech/mercantec/easyeat/ui/dishes/DishesFragment.kt @@ -17,6 +17,7 @@ import tech.mercantec.easyeat.helpers.ApiRequestException import tech.mercantec.easyeat.helpers.GetAllRecipesResponse import tech.mercantec.easyeat.helpers.getAllRecipes import tech.mercantec.easyeat.models.DishListItem +import tech.mercantec.easyeat.models.Recipe import kotlin.concurrent.thread class DishesFragment : Fragment() { diff --git a/app/app/src/main/java/tech/mercantec/easyeat/ui/dishes/GenerateRecipeActivity.kt b/app/app/src/main/java/tech/mercantec/easyeat/ui/dishes/GenerateRecipeActivity.kt index 94523f1..b4fc843 100644 --- a/app/app/src/main/java/tech/mercantec/easyeat/ui/dishes/GenerateRecipeActivity.kt +++ b/app/app/src/main/java/tech/mercantec/easyeat/ui/dishes/GenerateRecipeActivity.kt @@ -27,7 +27,7 @@ class GenerateRecipeActivity : AppCompatActivity() { progressDialog.show() thread { - val response: GenerateRecipeResponse +// val response: GenerateRecipeResponse try { val recipe = generateRecipeWithAI(this, name, Locale.getDefault().displayLanguage) diff --git a/app/app/src/main/res/layout/activity_dish_details.xml b/app/app/src/main/res/layout/activity_dish_details.xml index d431ab4..088988f 100644 --- a/app/app/src/main/res/layout/activity_dish_details.xml +++ b/app/app/src/main/res/layout/activity_dish_details.xml @@ -86,7 +86,7 @@ android:layout_marginHorizontal="10sp"/>