Fix and cleanup for Events.WebApi
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Events.WebAPI.Contract.Command;
|
||||
using Events.Auth;
|
||||
using Events.WebAPI.Contract.DTOs;
|
||||
using Events.WebAPI.Contract.Queries.Generic;
|
||||
using MediatR;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using AutoMapper;
|
||||
using Events.Auth;
|
||||
using Events.WebAPI.Contract.DTOs;
|
||||
using Events.WebAPI.Contract.Queries.Generic;
|
||||
using Events.WebAPI.Models;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Events.WebAPI.Contract.DTOs;
|
||||
using Events.Auth;
|
||||
using Events.WebAPI.Contract.LookupQueries;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
@@ -8,10 +9,10 @@ namespace Events.WebAPI.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("[controller]/[action]")]
|
||||
public class LookupController : ControllerBase
|
||||
public class LookupController(IMediator mediator) : ControllerBase
|
||||
{
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<List<IdName<string>>>> Countries(string? text, [FromServices] IMediator mediator)
|
||||
public async Task<ActionResult<List<IdName<string>>>> Countries(string? text)
|
||||
{
|
||||
var countries = await mediator.Send(new LookupCountryQuery { Text = text });
|
||||
return countries;
|
||||
@@ -19,7 +20,7 @@ public class LookupController : ControllerBase
|
||||
|
||||
[Authorize(Policy = nameof(Policies.ReadData))]
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<List<IdName<int>>>> People(string? text, string? countryCode, [FromServices] IMediator mediator)
|
||||
public async Task<ActionResult<List<IdName<int>>>> People(string? text, string? countryCode)
|
||||
{
|
||||
var people = await mediator.Send(new LookupPeopleQuery
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user