Update Service

master
Louis DUFOUR 2 years ago
parent c84814b2cf
commit e5373d04e7

@ -64,7 +64,7 @@ namespace ValblazeProject.Services
} }
/************ Inventory ************ /************ Inventory ************
public async Task supprInventory(Item item) public async Task supprInventory()
{ {
await _http.DeleteAsync("https://localhost:7234/api/Inventory"); await _http.DeleteAsync("https://localhost:7234/api/Inventory");
} }
@ -74,17 +74,17 @@ namespace ValblazeProject.Services
return await _http.GetFromJsonAsync<Inventory>("https://localhost:7234/api/Inventory"); return await _http.GetFromJsonAsync<Inventory>("https://localhost:7234/api/Inventory");
} }
public async Task putInventory(Item item) public async Task putInventory()
{ {
await _http.PutAsJsonAsync($"https://localhost:7234/api/Inventory"); await _http.PutAsJsonAsync($"https://localhost:7234/api/Inventory");
} }
public async Task postInventory(Item item) public async Task postInventory()
{ {
// Get the item // Get the inventory
//var inventory = ItemFactory.Create(item); var inventory = ItemFactory.Create(item);
// Save the data // Save the data
await _http.PostAsJsonAsync("https://localhost:7234/api/Inventory"); await _http.PostAsJsonAsync("https://localhost:7234/api/Inventory", inventory);
}*/ }*/
} }
} }

@ -202,7 +202,7 @@ namespace ValblazeProject.Services
} }
/************************ Inventory ************************ /************************ Inventory ************************
public async Task supprInventory(Item item) public async Task supprInventory()
{ {
// Get the current data // Get the current data
var currentData = await _localStorage.GetItemAsync<Inventory>("data"); var currentData = await _localStorage.GetItemAsync<Inventory>("data");

@ -17,8 +17,8 @@ namespace ValblazeProject.Services
/* Inventory /* Inventory
Task<Inventory> getInventory(); Task<Inventory> getInventory();
Task supprInventory(Item item); Task supprInventory();
Task postInventory(Item item); Task postInventory();
Task putInventory(Item item);*/ Task putInventory();*/
} }
} }

Loading…
Cancel
Save