This commit is contained in:
2020-07-10 18:09:01 +00:00
parent 671ab5cf2b
commit 1d529b1e73
3 changed files with 9 additions and 9 deletions

View File

@@ -57,17 +57,15 @@ namespace AyaNova.Api.Controllers
/// </summary>
/// <returns></returns>
[HttpGet("new-count")]
public ActionResult GetNewCount()
public async Task<IActionResult> GetNewCount()
{
//STUB: https://rockfish.ayanova.com/default.htm#!/rfcaseEdit/3783
if (serverState.IsClosed)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
System.Random rnd = new System.Random();
int RandomNewCount = rnd.Next(20);
return Ok(ApiOkResponse.Response(RandomNewCount));
var UserId = UserIdFromContext.Id(HttpContext.Items);
return Ok(ApiOkResponse.Response(await ct.Notification.CountAsync(z => z.UserId == UserId && z.Fetched == false)));
}
//------------