This commit is contained in:
@@ -68,9 +68,10 @@ namespace AyaNova.Api.Controllers
|
||||
[HttpGet("new-count")]
|
||||
public async Task<IActionResult> GetNewCount()
|
||||
{
|
||||
if (serverState.IsClosed)
|
||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||
var UserId = UserIdFromContext.Id(HttpContext.Items);
|
||||
if (serverState.IsClosed && UserId!=1)//bypass for superuser to fix fundamental problems
|
||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||
|
||||
return Ok(ApiOkResponse.Response(await ct.InAppNotification.CountAsync(z => z.UserId == UserId && z.Fetched == false)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user