mirror of
https://github.com/BarkProductions/barkman.git
synced 2026-06-13 06:11:55 +00:00
changed return
This commit is contained in:
@@ -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) =>
|
||||
|
||||
Reference in New Issue
Block a user