Refactored Browse Authors to be Browse People and allow the user to select the role to show.

After some experimentation, I think I need to implement the proper filtering system as there are 3 potential filters.

Added browse genres/tags on the top right nav bar temp while I figure out a better implementation for the idea.
This commit is contained in:
Joseph Milazzo 2025-06-07 11:33:50 -05:00
parent 7ef95b3e12
commit a7d4b11593
45 changed files with 326 additions and 98 deletions

View file

@ -5,6 +5,8 @@ using API.Data;
using API.Data.Repositories;
using API.DTOs;
using API.DTOs.Filtering.v2;
using API.DTOs.Metadata.Browse;
using API.DTOs.Metadata.Browse.Requests;
using API.DTOs.Person;
using API.Entities.Enums;
using API.Extensions;
@ -78,11 +80,11 @@ public class PersonController : BaseApiController
/// <param name="userParams"></param>
/// <returns></returns>
[HttpPost("all")]
public async Task<ActionResult<PagedList<BrowsePersonDto>>> GetAuthorsForBrowse([FromQuery] UserParams? userParams)
public async Task<ActionResult<PagedList<BrowsePersonDto>>> GetAuthorsForBrowse(BrowsePersonFilterDto filter, [FromQuery] UserParams? userParams)
{
userParams ??= UserParams.Default;
var list = await _unitOfWork.PersonRepository.GetBrowsePersonDtos(User.GetUserId(), [PersonRole.CoverArtist, PersonRole.Writer], userParams);
var list = await _unitOfWork.PersonRepository.GetBrowsePersonDtos(User.GetUserId(), filter, userParams);
Response.AddPaginationHeader(list.CurrentPage, list.PageSize, list.TotalCount, list.TotalPages);
return Ok(list);