mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-06-05 22:35:17 -04:00
Almost looking at a Mirror (#4341)
Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com>
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user