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:
Joseph Milazzo 2020-12-14 14:33:09 -06:00
parent a920be092d
commit 13ed323949
14 changed files with 172 additions and 65 deletions

View 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());
}
}
}