Almost looking at a Mirror (#4341)

Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com>
This commit is contained in:
Joe Milazzo
2026-01-11 16:50:22 -07:00
committed by GitHub
parent 0aa9ea29b6
commit a610a057c7
21 changed files with 206 additions and 141 deletions
+12 -2
View File
@@ -98,10 +98,15 @@ public class UsersController : BaseApiController
[Authorize]
public async Task<ActionResult<bool>> HasProfileShared(int userId)
{
var user = await _unitOfWork.UserRepository.GetUserByIdAsync(userId);
return Ok(user?.UserPreferences.SocialPreferences.ShareProfile);
var user = await _unitOfWork.UserRepository.GetUserByIdAsync(userId, AppUserIncludes.UserPreferences);
return Ok(user?.UserPreferences?.SocialPreferences?.ShareProfile ?? false);
}
/// <summary>
/// Is there any reading progress on this library
/// </summary>
/// <param name="libraryId"></param>
/// <returns></returns>
[HttpGet("has-reading-progress")]
public async Task<ActionResult<bool>> HasReadingProgress(int libraryId)
{
@@ -110,6 +115,11 @@ public class UsersController : BaseApiController
return Ok(await _unitOfWork.AppUserProgressRepository.UserHasProgress(library.Type, UserId));
}
/// <summary>
/// Does the user have access to this library
/// </summary>
/// <param name="libraryId"></param>
/// <returns></returns>
[HttpGet("has-library-access")]
public async Task< ActionResult<bool>> HasLibraryAccess(int libraryId)
{