From 73d58aea4ff066c18af80631e10dadb5ca48b7eb Mon Sep 17 00:00:00 2001 From: Drew Rautenberg Date: Wed, 29 Jan 2025 20:03:49 -0600 Subject: [PATCH] changed return --- barkmanAPI/Program.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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) =>