diff --git a/barkmanAPI/Program.cs b/barkmanAPI/Program.cs index 154f591..3e90fc1 100644 --- a/barkmanAPI/Program.cs +++ b/barkmanAPI/Program.cs @@ -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(); @@ -94,10 +93,10 @@ inventoryGroup.MapPost("", async (InventoryItems newItemInput, BarkContext db) = newItem.RentalPrice = newItemInput.RentalPrice; newItem.ReplacementCost = newItemInput.ReplacementCost; newItem.StatusId = "ready"; - + 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) =>