shoppinglistdbaccess comments

This commit is contained in:
Jeas0001 2025-05-07 13:14:41 +02:00
parent fe90c243e2
commit dee0ea54a2

View File

@ -14,6 +14,8 @@ namespace API.DBAccess
{
_context = context;
}
// Read the shoppinglist connected to the user
public async Task<User> ReadShoppingList(int userId)
{
var user = await _context.Users.Include(u => u.ShoppingList).FirstOrDefaultAsync(u => u.Id == userId);
@ -21,6 +23,7 @@ namespace API.DBAccess
return user;
}
// Updates the shoppinglist
public async Task<IActionResult> UpdateShoppingList(User user)
{
_context.Entry(user).State = EntityState.Modified;