using AbrBlazorTools; using System.Net.Http; using System.Threading.Tasks; namespace Panel.ApiUtils { public class PlantsUtils : IPlantsUtils { private readonly IHttpClientWithLoginToken _client; public PlantsUtils(IHttpClientWithLoginToken client) { _client = client; } public Task List() { return _client.HttpGet("/api/Plants/List"); } public Task Add(object plantModel) { return _client.HttpPost("/api/Plants/Add", plantModel); } public Task Update(object plantModel) { return _client.HttpPut("/api/Plants/Update", plantModel); } public Task Delete(Guid id) { return _client.HttpDelete($"/api/Plants/Delete/{id}"); } } public interface IPlantsUtils { Task List(); Task Add(object plantModel); Task Update(object plantModel); Task Delete(Guid id); } }