Added new API for getting Member (aka Users but for use in FE). User is just used for login/registering.
This commit is contained in:
parent
a920be092d
commit
13ed323949
14 changed files with 172 additions and 65 deletions
28
API/Controllers/UsersController.cs
Normal file
28
API/Controllers/UsersController.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using API.Data;
|
||||
using API.DTOs;
|
||||
using API.Interfaces;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace API.Controllers
|
||||
{
|
||||
public class UsersController : BaseApiController
|
||||
{
|
||||
private readonly DataContext _context;
|
||||
private readonly IUserRepository _userRepository;
|
||||
|
||||
public UsersController(DataContext context, IUserRepository userRepository)
|
||||
{
|
||||
_context = context;
|
||||
_userRepository = userRepository;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<MemberDto>>> GetUsers()
|
||||
{
|
||||
return Ok(await _userRepository.GetMembersAsync());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue