|
|
|
@ -11,18 +11,18 @@ namespace ProjetBlazor.Services
|
|
|
|
|
_http = http;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task AddInPlaylist(Musique musique)
|
|
|
|
|
public async Task Add(Musique musique)
|
|
|
|
|
{
|
|
|
|
|
// Get the item
|
|
|
|
|
//var item = ItemFactory.Create(model);
|
|
|
|
|
|
|
|
|
|
// Save the data
|
|
|
|
|
await _http.PostAsJsonAsync("https://localhost:7234/api/", musique);
|
|
|
|
|
await _http.PostAsJsonAsync("https://localhost:7234/api/controleur/", musique);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Task<List<Musique>> List(int currentPage, int pageSize)
|
|
|
|
|
public async Task<List<Musique>> List(int currentPage, int pageSize)
|
|
|
|
|
{
|
|
|
|
|
return await _http.GetFromJsonAsync<List<Musique>>($"https://localhost:7234/api/Crafting/?currentPage={currentPage}&pageSize={pageSize}");
|
|
|
|
|
return await _http.GetFromJsonAsync<List<Musique>>($"https://localhost:7234/api/controleur/?currentPage={currentPage}&pageSize={pageSize}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|