changed return

This commit is contained in:
2025-01-29 20:03:49 -06:00
parent 4c844a8051
commit 73d58aea4f
+1 -2
View File
@@ -84,7 +84,6 @@ inventoryGroup.MapPut("/{id}", async (int id, InventoryItems updatedItem, BarkCo
return Results.Ok(existingItem);
});
inventoryGroup.MapPost("", async (InventoryItems newItemInput, BarkContext db) =>
{
var newItem = new InventoryItems();
@@ -97,7 +96,7 @@ inventoryGroup.MapPost("", async (InventoryItems newItemInput, BarkContext db) =
db.Inventory.Add(newItem);
await db.SaveChangesAsync();
return Results.Created($"/inventory/{newItemInput.Id}", newItemInput);
return Results.Created($"/inventory/{newItem.Id}", newItem);
});
inventoryGroup.MapDelete("/{id}", async (int id, BarkContext db) =>