Files
blazor-swm/Features/Sales/CommissionReport/CommissionReportService.cs
T
2026-07-21 14:35:37 +07:00

32 lines
1.1 KiB
C#

using Indotalent.ConfigBackEnd.Interfaces;
using Indotalent.ConfigFrontEnd.Common;
using Indotalent.Features.Sales.CommissionReport.Cqrs;
using Indotalent.Infrastructure.Authentication.Identity;
using Indotalent.Shared.Models;
using Microsoft.AspNetCore.Components;
using MudBlazor;
using RestSharp;
namespace Indotalent.Features.Sales.CommissionReport;
public class CommissionReportService : BaseService
{
private readonly RestClient _client;
public CommissionReportService(
IHttpClientFactory clientFactory,
NavigationManager nav,
ISnackbar snackbar,
ICurrentUserService currentUserService,
TokenProvider tokenProvider)
: base(clientFactory, nav, snackbar, currentUserService, tokenProvider)
{
_client = new RestClient(nav.BaseUri);
}
public async Task<ApiResponse<List<GetCommissionReportListResponse>>?> GetCommissionReportListAsync()
{
var request = new RestRequest("api/commission-report", Method.Get);
return await ExecuteWithResponseAsync<List<GetCommissionReportListResponse>>(_client, request);
}
}