From e5373d04e7b4e06e673ec5f9b1578064e2f2f14d Mon Sep 17 00:00:00 2001 From: Louis DUFOUR Date: Thu, 29 Dec 2022 23:01:50 +0100 Subject: [PATCH] Update Service --- ValblazeProject/Pages/Services/DataApiService.cs | 12 ++++++------ ValblazeProject/Pages/Services/DataLocalService.cs | 2 +- ValblazeProject/Pages/Services/IDataService.cs | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ValblazeProject/Pages/Services/DataApiService.cs b/ValblazeProject/Pages/Services/DataApiService.cs index ccdd82c..c85e0f9 100644 --- a/ValblazeProject/Pages/Services/DataApiService.cs +++ b/ValblazeProject/Pages/Services/DataApiService.cs @@ -64,7 +64,7 @@ namespace ValblazeProject.Services } /************ Inventory ************ - public async Task supprInventory(Item item) + public async Task supprInventory() { await _http.DeleteAsync("https://localhost:7234/api/Inventory"); } @@ -74,17 +74,17 @@ namespace ValblazeProject.Services return await _http.GetFromJsonAsync("https://localhost:7234/api/Inventory"); } - public async Task putInventory(Item item) + public async Task putInventory() { await _http.PutAsJsonAsync($"https://localhost:7234/api/Inventory"); } - public async Task postInventory(Item item) + public async Task postInventory() { - // Get the item - //var inventory = ItemFactory.Create(item); + // Get the inventory + var inventory = ItemFactory.Create(item); // Save the data - await _http.PostAsJsonAsync("https://localhost:7234/api/Inventory"); + await _http.PostAsJsonAsync("https://localhost:7234/api/Inventory", inventory); }*/ } } diff --git a/ValblazeProject/Pages/Services/DataLocalService.cs b/ValblazeProject/Pages/Services/DataLocalService.cs index 86d24f8..1ca8e7f 100644 --- a/ValblazeProject/Pages/Services/DataLocalService.cs +++ b/ValblazeProject/Pages/Services/DataLocalService.cs @@ -202,7 +202,7 @@ namespace ValblazeProject.Services } /************************ Inventory ************************ - public async Task supprInventory(Item item) + public async Task supprInventory() { // Get the current data var currentData = await _localStorage.GetItemAsync("data"); diff --git a/ValblazeProject/Pages/Services/IDataService.cs b/ValblazeProject/Pages/Services/IDataService.cs index 027c0b4..42a1291 100644 --- a/ValblazeProject/Pages/Services/IDataService.cs +++ b/ValblazeProject/Pages/Services/IDataService.cs @@ -17,8 +17,8 @@ namespace ValblazeProject.Services /* Inventory Task getInventory(); - Task supprInventory(Item item); - Task postInventory(Item item); - Task putInventory(Item item);*/ + Task supprInventory(); + Task postInventory(); + Task putInventory();*/ } }