Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions EventPlatform.WebApi/Controllers/EventsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,10 @@ namespace EventPlatform.WebApi.Controllers
public class EventsController : ControllerBase
{
private readonly IEventService _eventService;
private readonly HttpClient _httpClient;
private readonly IConfiguration _configuration;

public EventsController(IEventService eventService, HttpClient httpClient, IConfiguration configuration)
public EventsController(IEventService eventService)
{
_eventService = eventService;
_httpClient = httpClient;
_configuration = configuration;
}

/// <param name="query">Tham số tìm kiếm, lọc, phân trang</param>
Expand Down Expand Up @@ -97,14 +93,6 @@ public async Task<ActionResult> CreateEvent([FromBody] CreateEventRequest create
SaleEndDate = t.SaleEndDate,
}).ToList();
await _eventService.CreateTicketTypes(newTicketTypes);
// Lấy Base URL từ cấu hình
var fastApiBaseUrl = UrlHelper.GetFastAPIUrl(_configuration); ;

// Dựng URL cho action UPSERT
var fastApiUrl = $"{fastApiBaseUrl}/internal/events/manage/{newEvent.EventId}?action=UPSERT";

// Gửi yêu cầu POST (không cần body vì FastAPI sẽ tự lấy data từ CSDL)
var response = await _httpClient.PostAsync(fastApiUrl, null);
}
catch (Exception ex)
{
Expand Down
Loading