diff --git a/app/app/src/main/java/tech/mercantec/easyeat/helpers/api.kt b/app/app/src/main/java/tech/mercantec/easyeat/helpers/api.kt index 914db0a..94c200b 100644 --- a/app/app/src/main/java/tech/mercantec/easyeat/helpers/api.kt +++ b/app/app/src/main/java/tech/mercantec/easyeat/helpers/api.kt @@ -102,6 +102,6 @@ inline fun requestJson(ctx: Context, method: String, Log.e("EasyEat", e.message!!) Log.e("EasyEat", response.body) - throw ApiRequestException("Failed to parse response: $response", e) + throw ApiRequestException("Failed to parse response: ${response.body}", e) } } diff --git a/app/app/src/main/java/tech/mercantec/easyeat/helpers/shopping_list.kt b/app/app/src/main/java/tech/mercantec/easyeat/helpers/shopping_list.kt index 740f9fb..a9adbc8 100644 --- a/app/app/src/main/java/tech/mercantec/easyeat/helpers/shopping_list.kt +++ b/app/app/src/main/java/tech/mercantec/easyeat/helpers/shopping_list.kt @@ -2,9 +2,7 @@ package tech.mercantec.easyeat.helpers import android.content.Context import kotlinx.serialization.Serializable - -@Serializable -data class ShoppingListItem(val id: Int, val name: String, val amount: Double?, val unit: String?, val checked: Boolean) +import tech.mercantec.easyeat.models.ShoppingListItem fun getShoppingList(ctx: Context): Array { return requestJson>(ctx, "GET", "/api/ShoppingList/get", null) @@ -13,8 +11,16 @@ fun getShoppingList(ctx: Context): Array { @Serializable data class AddShoppingItemRequest(val name: String, val amount: Double?, val unit: String?, val checked: Boolean) -fun addShoppingItem(ctx: Context, name: String, amount: Double?, unit: String?) { +fun addShoppingItem(ctx: Context, name: String, amount: Double?, unit: String?): ShoppingListItem { val request = AddShoppingItemRequest(name, amount, unit, false) - requestJson(ctx, "POST", "/api/ShoppingList/add", request) + return requestJson(ctx, "POST", "/api/ShoppingList/add", request) +} + +fun toggleShoppingItemChecked(ctx: Context, item: ShoppingListItem) { + requestJson(ctx, "PUT", "/api/ShoppingList/check?itemId=${item.id}", null) +} + +fun deleteShoppingItem(ctx: Context, item: ShoppingListItem) { + requestJson(ctx, "DELETE", "/api/ShoppingList/delete?itemId=${item.id}", null) } diff --git a/app/app/src/main/java/tech/mercantec/easyeat/models/ShoppingListItem.kt b/app/app/src/main/java/tech/mercantec/easyeat/models/ShoppingListItem.kt new file mode 100644 index 0000000..a97a6a7 --- /dev/null +++ b/app/app/src/main/java/tech/mercantec/easyeat/models/ShoppingListItem.kt @@ -0,0 +1,6 @@ +package tech.mercantec.easyeat.models + +import kotlinx.serialization.Serializable + +@Serializable +data class ShoppingListItem(val id: Int, var name: String, var amount: Double?, var unit: String?, var checked: Boolean) diff --git a/app/app/src/main/java/tech/mercantec/easyeat/ui/shopping_list/ShoppingItemAdapter.kt b/app/app/src/main/java/tech/mercantec/easyeat/ui/shopping_list/ShoppingItemAdapter.kt new file mode 100644 index 0000000..be952f2 --- /dev/null +++ b/app/app/src/main/java/tech/mercantec/easyeat/ui/shopping_list/ShoppingItemAdapter.kt @@ -0,0 +1,60 @@ +package tech.mercantec.easyeat.ui.shopping_list + +import android.content.Context +import android.graphics.Paint +import android.icu.text.DecimalFormat +import android.util.TypedValue +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.ArrayAdapter +import android.widget.ImageView +import android.widget.TextView +import androidx.core.content.ContextCompat +import tech.mercantec.easyeat.R +import tech.mercantec.easyeat.models.ShoppingListItem + +class ShoppingItemAdapter(context: Context, items: ArrayList) + : ArrayAdapter(context, R.layout.shopping_list_item, items) { + + override fun getView(position: Int, convertView: View?, parent: ViewGroup): View { + val item = getItem(position) + val view = convertView ?: LayoutInflater.from(context).inflate(R.layout.shopping_list_item, parent, false) + + item?.let { item -> + val checkmarkView = view.findViewById(R.id.checkmark) + val amountView = view.findViewById(R.id.amount) + val unitView = view.findViewById(R.id.unit) + val nameView = view.findViewById(R.id.name) + val textViews = listOf(amountView, unitView, nameView) + + amountView.text = DecimalFormat("#.##").format(item.amount) + unitView.text = item.unit + nameView.text = item.name + + if (item.checked) { + textViews.forEach { + it.paintFlags = it.paintFlags or Paint.STRIKE_THRU_TEXT_FLAG + + val color = TypedValue() + context.theme.resolveAttribute(R.attr.colorDisabled, color, true) + it.setTextColor(ContextCompat.getColor(context, color.resourceId)) + + checkmarkView.visibility = View.VISIBLE + } + } else { + textViews.forEach { + it.paintFlags = it.paintFlags and Paint.STRIKE_THRU_TEXT_FLAG.inv() + + val color = TypedValue() + context.theme.resolveAttribute(android.R.attr.textColorSecondary, color, true) + it.setTextColor(ContextCompat.getColor(context, color.resourceId)) + + checkmarkView.visibility = View.INVISIBLE + } + } + } + + return view + } +} diff --git a/app/app/src/main/java/tech/mercantec/easyeat/ui/shopping_list/ShoppingListFragment.kt b/app/app/src/main/java/tech/mercantec/easyeat/ui/shopping_list/ShoppingListFragment.kt index 878cab7..7267253 100644 --- a/app/app/src/main/java/tech/mercantec/easyeat/ui/shopping_list/ShoppingListFragment.kt +++ b/app/app/src/main/java/tech/mercantec/easyeat/ui/shopping_list/ShoppingListFragment.kt @@ -1,13 +1,13 @@ package tech.mercantec.easyeat.ui.shopping_list import android.app.AlertDialog -import android.app.Dialog import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.ArrayAdapter import android.widget.EditText +import android.widget.PopupMenu import android.widget.Spinner import android.widget.Toast import androidx.fragment.app.Fragment @@ -15,24 +15,106 @@ import tech.mercantec.easyeat.R import tech.mercantec.easyeat.databinding.FragmentShoppingListBinding import tech.mercantec.easyeat.helpers.ApiRequestException import tech.mercantec.easyeat.helpers.addShoppingItem +import tech.mercantec.easyeat.helpers.deleteShoppingItem +import tech.mercantec.easyeat.helpers.getShoppingList +import tech.mercantec.easyeat.helpers.toggleShoppingItemChecked +import tech.mercantec.easyeat.models.ShoppingListItem +import java.util.ArrayList import kotlin.concurrent.thread class ShoppingListFragment : Fragment() { - - private var _binding: FragmentShoppingListBinding? = null - - // This property is only valid between onCreateView and - // onDestroyView. - private val binding get() = _binding!! - override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View { - _binding = FragmentShoppingListBinding.inflate(inflater, container, false) - val root: View = binding.root + val binding = FragmentShoppingListBinding.inflate(inflater, container, false) + binding.shoppingList.visibility = View.GONE + binding.emptyShoppingList.visibility = View.GONE + binding.addToShoppingList.visibility = View.GONE + binding.loading.visibility = View.VISIBLE + + // Fetch shopping list items + thread { + val items: Array + try { + items = getShoppingList(requireContext()) + } catch (e: ApiRequestException) { + activity?.runOnUiThread { + Toast.makeText(context, e.message, Toast.LENGTH_LONG).show() + + binding.loading.visibility = View.GONE + } + + return@thread + } + + activity?.runOnUiThread { + binding.shoppingList.visibility = View.VISIBLE + binding.emptyShoppingList.visibility = View.VISIBLE + binding.addToShoppingList.visibility = View.VISIBLE + binding.loading.visibility = View.GONE + + binding.shoppingList.emptyView = binding.emptyShoppingList + binding.shoppingList.adapter = ShoppingItemAdapter(requireContext(), ArrayList(items.toMutableList())) + } + } + + // Check / uncheck when clicking shopping item + binding.shoppingList.setOnItemClickListener { parent, view, position, id -> + val item = parent.getItemAtPosition(position) as ShoppingListItem + item.checked = !item.checked + + thread { + try { + toggleShoppingItemChecked(requireContext(), item) + } catch (e: ApiRequestException) { + Toast.makeText(requireContext(), e.message, Toast.LENGTH_LONG).show() + } + } + + val adapter = parent.adapter as ShoppingItemAdapter + + adapter.remove(item) + adapter.insert(item, position) + } + + // Show context menu when long clicking shopping item + binding.shoppingList.setOnItemLongClickListener { parent, view, position, id -> + val item = parent.getItemAtPosition(position) as ShoppingListItem + + val popup = PopupMenu(requireActivity(), view) + popup.apply { + menuInflater.inflate(R.menu.shopping_item_context_menu, menu) + setOnMenuItemClickListener { + when (it.itemId) { + R.id.remove_shopping_item -> { + (parent.adapter as ShoppingItemAdapter).remove(item) + + thread { + try { + deleteShoppingItem(requireContext(), item) + } catch (e: ApiRequestException) { + activity?.runOnUiThread { + Toast.makeText(context, e.message, Toast.LENGTH_LONG).show() + } + } + } + + true + } + else -> false + } + } + show() + } + + + return@setOnItemLongClickListener true + } + + // Show new item dialog when clicking add binding.addToShoppingList.setOnClickListener { val view = requireActivity().layoutInflater.inflate(R.layout.dialog_add_to_shopping_list, null) @@ -49,17 +131,35 @@ class ShoppingListFragment : Fragment() { dialog.getButton(AlertDialog.BUTTON_NEGATIVE).isEnabled = false thread { + val item: ShoppingListItem try { - addShoppingItem(requireContext(), name, amount, unit) + item = addShoppingItem(requireContext(), name, amount, unit) } catch (e: ApiRequestException) { activity?.runOnUiThread { Toast.makeText(context, e.message, Toast.LENGTH_LONG).show() } + + return@thread } finally { activity?.runOnUiThread { dialog.dismiss() } } + + activity?.runOnUiThread { + val adapter = binding.shoppingList.adapter as ShoppingItemAdapter + + for (i in 0 ..< adapter.count) { + if (adapter.getItem(i)?.id == item.id) { + adapter.remove(adapter.getItem(i)) + adapter.insert(item, i) + + return@runOnUiThread + } + } + + adapter.insert(item, adapter.count) + } } } .setNegativeButton(R.string.cancel_label) { dialog, _ -> @@ -75,11 +175,6 @@ class ShoppingListFragment : Fragment() { dialog.findViewById(R.id.unit_selector).adapter = adapter } - return root - } - - override fun onDestroyView() { - super.onDestroyView() - _binding = null + return binding.root } } \ No newline at end of file diff --git a/app/app/src/main/res/drawable/ic_check_24px.xml b/app/app/src/main/res/drawable/ic_check_24px.xml new file mode 100644 index 0000000..280f0bd --- /dev/null +++ b/app/app/src/main/res/drawable/ic_check_24px.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/app/src/main/res/drawable/ic_delete_24px.xml b/app/app/src/main/res/drawable/ic_delete_24px.xml new file mode 100644 index 0000000..d1ed443 --- /dev/null +++ b/app/app/src/main/res/drawable/ic_delete_24px.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/app/src/main/res/layout/activity_main.xml b/app/app/src/main/res/layout/activity_main.xml index 37665d9..e338c8e 100644 --- a/app/app/src/main/res/layout/activity_main.xml +++ b/app/app/src/main/res/layout/activity_main.xml @@ -2,11 +2,9 @@ + android:layout_height="match_parent"> - + + + + - + diff --git a/app/app/src/main/res/layout/shopping_list_item.xml b/app/app/src/main/res/layout/shopping_list_item.xml new file mode 100644 index 0000000..f71e2d3 --- /dev/null +++ b/app/app/src/main/res/layout/shopping_list_item.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + diff --git a/app/app/src/main/res/menu/shopping_item_context_menu.xml b/app/app/src/main/res/menu/shopping_item_context_menu.xml new file mode 100644 index 0000000..48be440 --- /dev/null +++ b/app/app/src/main/res/menu/shopping_item_context_menu.xml @@ -0,0 +1,8 @@ + + + + diff --git a/app/app/src/main/res/values-night/themes.xml b/app/app/src/main/res/values-night/themes.xml index a8f2ade..91d3f75 100644 --- a/app/app/src/main/res/values-night/themes.xml +++ b/app/app/src/main/res/values-night/themes.xml @@ -4,6 +4,7 @@ @color/dark_cyan @color/white @color/dark_gray + @color/dark_gray @color/dark_cyan ?attr/colorPrimaryVariant @color/black diff --git a/app/app/src/main/res/values/attrs.xml b/app/app/src/main/res/values/attrs.xml new file mode 100644 index 0000000..d82cf71 --- /dev/null +++ b/app/app/src/main/res/values/attrs.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/app/app/src/main/res/values/colors.xml b/app/app/src/main/res/values/colors.xml index 9c94335..4af2f08 100644 --- a/app/app/src/main/res/values/colors.xml +++ b/app/app/src/main/res/values/colors.xml @@ -7,4 +7,5 @@ #FF242424 #FFF9F9F9 #D62D2D + #4CAF50 diff --git a/app/app/src/main/res/values/strings.xml b/app/app/src/main/res/values/strings.xml index 3c50a80..3ea29e3 100644 --- a/app/app/src/main/res/values/strings.xml +++ b/app/app/src/main/res/values/strings.xml @@ -38,6 +38,9 @@ Beef Change password Log out + Checked + Delete + Your shopping list is empty g diff --git a/app/app/src/main/res/values/themes.xml b/app/app/src/main/res/values/themes.xml index 30afe6a..eff4e5d 100644 --- a/app/app/src/main/res/values/themes.xml +++ b/app/app/src/main/res/values/themes.xml @@ -4,6 +4,7 @@ @color/dark_cyan @color/white @color/dark_gray + @color/gray ?attr/colorPrimaryVariant @color/white diff --git a/backend/API/BusinessLogic/ShoppingListLogic.cs b/backend/API/BusinessLogic/ShoppingListLogic.cs index 1651896..bcadc5c 100644 --- a/backend/API/BusinessLogic/ShoppingListLogic.cs +++ b/backend/API/BusinessLogic/ShoppingListLogic.cs @@ -28,63 +28,32 @@ namespace API.BusinessLogic { var user = await _dbAccess.ReadShoppingList(userId); - List shoppingList = user.ShoppingList; + List shoppingList = user.ShoppingList; if (shoppingList.Any(s => s.Name == listItemDTO.Name)) { - ShoppingList item = shoppingList.Where(s => s.Name == listItemDTO.Name).FirstOrDefault(); + ShoppingListItem item = shoppingList.Where(s => s.Name == listItemDTO.Name).FirstOrDefault(); shoppingList.Remove(item); - - if (item.Unit == listItemDTO.Unit) - { - item.Amount += listItemDTO.Amount; - } - else if (item.Unit == "g" && listItemDTO.Unit == "kg") - { - item.Amount = (item.Amount / 1000) + listItemDTO.Amount; - item.Unit = "kg"; - } - else if (item.Unit == "ml" && listItemDTO.Unit == "l") - { - item.Amount = (item.Amount / 1000) + listItemDTO.Amount; - item.Unit = "l"; - } - else if (item.Unit == "dl" && listItemDTO.Unit == "l") - { - item.Amount = (item.Amount / 10) + listItemDTO.Amount; - item.Unit = "l"; - } - - item.Checked = false; - - if (item.Unit == "g" && item.Amount >= 1000) - { - item.Unit = "kg"; - item.Amount = item.Amount / 1000; - } - else if (item.Unit == "ml" && item.Amount >= 1000) - { - item.Unit = "l"; - item.Amount = item.Amount / 1000; - } - else if (item.Unit == "dl" && item.Amount >= 10) - { - item.Unit = "l"; - item.Amount = item.Amount / 10; - } - user.ShoppingList.Add(item); + + user.ShoppingList.Add(await UnitAdjustmentSameName(listItemDTO, item)); } else { - ShoppingList newItem = new ShoppingList(); + ShoppingListItem newItem = new ShoppingListItem(); newItem.Name = listItemDTO.Name; newItem.Amount = listItemDTO.Amount; newItem.Unit = listItemDTO.Unit; newItem.Checked = false; - user.ShoppingList.Add(newItem); + user.ShoppingList.Add(await UnitAdjustment(newItem)); } - return await _dbAccess.UpdateShoppingList(user); + bool succes = await _dbAccess.AddItemToShoppingList(user); + + var updatedShoppingList = await _dbAccess.ReadShoppingList(userId); + + if (succes) { return new OkObjectResult(updatedShoppingList.ShoppingList.Where(s => s.Name == listItemDTO.Name).First()); } + + return new ConflictObjectResult(new { message = "Could not save to database" }); } // Gets the shoppinglist and tries to find the item and when it does it checks/unchecks that item @@ -134,11 +103,11 @@ namespace API.BusinessLogic { var user = await _dbAccess.ReadShoppingList(userId); - int itemIndex = user.ShoppingList.FindIndex(x => x.Id == itemId); + var item = user.ShoppingList.Where(x => x.Id == itemId).FirstOrDefault(); - user.ShoppingList.RemoveAt(itemIndex); + if (item == null) { return new ConflictObjectResult(new { message = "Could not find item" }); } - return await _dbAccess.UpdateShoppingList(user); + return await _dbAccess.DeleteItemFromShoppinglist(item); } // Adds an entire recipes ingredients to the shoppinglist @@ -150,66 +119,96 @@ namespace API.BusinessLogic foreach (var ingredient in ingredients) { - List shoppingList = user.ShoppingList; + List shoppingList = user.ShoppingList; if (shoppingList.Any(s => s.Name == ingredient.Name)) { - ShoppingList item = shoppingList.Where(s => s.Name == ingredient.Name).FirstOrDefault(); + ShoppingListItem item = shoppingList.Where(s => s.Name == ingredient.Name).FirstOrDefault(); shoppingList.Remove(item); - if (item.Unit == ingredient.Unit) - { - item.Amount += ingredient.Amount; - } - else if (item.Unit == "g" && ingredient.Unit == "kg") - { - item.Amount = (item.Amount / 1000) + ingredient.Amount; - item.Unit = "kg"; - } - else if (item.Unit == "ml" && item.Unit == "l") - { - item.Amount = (item.Amount / 1000) + ingredient.Amount; - item.Unit = "l"; - } - else if (item.Unit == "dl" && item.Unit == "l") - { - item.Amount = (item.Amount / 10) + ingredient.Amount; - item.Unit = "l"; - } + ShoppingListItemDTO listItemDTO = new ShoppingListItemDTO(); + listItemDTO.Name = ingredient.Name; + listItemDTO.Amount = ingredient.Amount; + listItemDTO.Unit = ingredient.Unit; + listItemDTO.Checked = false; - item.Checked = false; - - if (item.Unit == "g" && item.Amount >= 1000) - { - item.Unit = "kg"; - item.Amount = item.Amount / 1000; - } - else if (item.Unit == "ml" && item.Amount >= 1000) - { - item.Unit = "l"; - item.Amount = item.Amount / 1000; - } - else if (item.Unit == "dl" && item.Amount >= 10) - { - item.Unit = "l"; - item.Amount = item.Amount / 10; - } - - user.ShoppingList.Add(item); + user.ShoppingList.Add(await UnitAdjustmentSameName(listItemDTO, item)); } else { - ShoppingList newItem = new ShoppingList(); + ShoppingListItem newItem = new ShoppingListItem(); newItem.Name = ingredient.Name; newItem.Amount = ingredient.Amount; newItem.Unit = ingredient.Unit; newItem.Checked = false; - user.ShoppingList.Add(newItem); + user.ShoppingList.Add(await UnitAdjustment(newItem)); } } return await _dbAccess.UpdateShoppingList(user); } + + public async Task UnitAdjustmentSameName(ShoppingListItemDTO listItemDTO, ShoppingListItem listItem) + { + if (listItem.Unit == listItemDTO.Unit) + { + listItem.Amount += listItemDTO.Amount; + } + else if (listItem.Unit == "g" && listItemDTO.Unit == "kg") + { + listItem.Amount = (listItem.Amount / 1000) + listItemDTO.Amount; + listItem.Unit = "kg"; + } + else if (listItem.Unit == "kg" && listItemDTO.Unit == "g") + { + listItem.Amount = (listItemDTO.Amount / 1000) + listItem.Amount; + listItem.Unit = "kg"; + } + else if (listItem.Unit == "ml" && listItemDTO.Unit == "l") + { + listItem.Amount = (listItem.Amount / 1000) + listItemDTO.Amount; + listItem.Unit = "l"; + } + else if (listItem.Unit == "l" && listItemDTO.Unit == "ml") + { + listItem.Amount = (listItemDTO.Amount / 1000) + listItem.Amount; + listItem.Unit = "l"; + } + else if (listItem.Unit == "dl" && listItemDTO.Unit == "l") + { + listItem.Amount = (listItem.Amount / 10) + listItemDTO.Amount; + listItem.Unit = "l"; + } + else if (listItem.Unit == "l" && listItemDTO.Unit == "dl") + { + listItem.Amount = (listItemDTO.Amount / 10) + listItem.Amount; + listItem.Unit = "l"; + } + + listItem.Checked = false; + + return await UnitAdjustment(listItem); + } + + public async Task UnitAdjustment(ShoppingListItem listItem) + { + if (listItem.Unit == "g" && listItem.Amount >= 1000) + { + listItem.Unit = "kg"; + listItem.Amount = listItem.Amount / 1000; + } + else if (listItem.Unit == "ml" && listItem.Amount >= 1000) + { + listItem.Unit = "l"; + listItem.Amount = listItem.Amount / 1000; + } + else if (listItem.Unit == "dl" && listItem.Amount >= 10) + { + listItem.Unit = "l"; + listItem.Amount = listItem.Amount / 10; + } + return listItem; + } } } diff --git a/backend/API/BusinessLogic/UserLogic.cs b/backend/API/BusinessLogic/UserLogic.cs index f32bd2e..1cbf349 100644 --- a/backend/API/BusinessLogic/UserLogic.cs +++ b/backend/API/BusinessLogic/UserLogic.cs @@ -67,7 +67,7 @@ namespace API.BusinessLogic Password = hashedPassword, Salt = salt, Recipes = new List(), - ShoppingList = new List(), + ShoppingList = new List(), }; return await _dbAccess.CreateUser(user); diff --git a/backend/API/DBAccess/DBContext.cs b/backend/API/DBAccess/DBContext.cs index b18f88e..058193a 100644 --- a/backend/API/DBAccess/DBContext.cs +++ b/backend/API/DBAccess/DBContext.cs @@ -11,7 +11,7 @@ namespace API.DBAccess public DbSet Recipes { get; set; } - public DbSet ShoppingList { get; set; } + public DbSet ShoppingList { get; set; } public DBContext(DbContextOptions options) : base(options) { } } diff --git a/backend/API/DBAccess/ShoppingListDBAccess.cs b/backend/API/DBAccess/ShoppingListDBAccess.cs index a9e7c68..dd8b50a 100644 --- a/backend/API/DBAccess/ShoppingListDBAccess.cs +++ b/backend/API/DBAccess/ShoppingListDBAccess.cs @@ -34,5 +34,27 @@ namespace API.DBAccess return new ConflictObjectResult(new { message = "Could not save to database" }); } + + // Adds an item to the shoppinglist + public async Task AddItemToShoppingList(User user) + { + _context.Entry(user).State = EntityState.Modified; + + bool saved = await _context.SaveChangesAsync() >= 1; + + if (saved) { return true; } + + return false; + } + + public async Task DeleteItemFromShoppinglist(ShoppingListItem item) + { + _context.ShoppingList.Remove(item); + bool saved = await _context.SaveChangesAsync() >= 0; + + if (saved) { return new OkObjectResult(saved); } + + return new ConflictObjectResult(new { message = "Could not save to database" }); + } } } diff --git a/backend/API/Models/ShoppingListModels/ShoppingList.cs b/backend/API/Models/ShoppingListModels/ShoppingListItem.cs similarity index 88% rename from backend/API/Models/ShoppingListModels/ShoppingList.cs rename to backend/API/Models/ShoppingListModels/ShoppingListItem.cs index 648e9dc..badee1d 100644 --- a/backend/API/Models/ShoppingListModels/ShoppingList.cs +++ b/backend/API/Models/ShoppingListModels/ShoppingListItem.cs @@ -1,6 +1,6 @@ namespace API.Models.ShoppingListModels { - public class ShoppingList + public class ShoppingListItem { public int Id { get; set; } diff --git a/backend/API/Models/UserModels/User.cs b/backend/API/Models/UserModels/User.cs index 3b13e51..dd196d5 100644 --- a/backend/API/Models/UserModels/User.cs +++ b/backend/API/Models/UserModels/User.cs @@ -21,6 +21,6 @@ namespace API.Models.UserModels public List Recipes { get; set; } - public List ShoppingList { get; set; } + public List ShoppingList { get; set; } } }