diff --git a/server/AyaNova/Controllers/NotifyController.cs b/server/AyaNova/Controllers/NotifyController.cs
index c7280434..70a6090a 100644
--- a/server/AyaNova/Controllers/NotifyController.cs
+++ b/server/AyaNova/Controllers/NotifyController.cs
@@ -65,6 +65,20 @@ namespace AyaNova.Api.Controllers
return Ok(ApiOkResponse.Response(await ct.Notification.CountAsync(z => z.UserId == UserId && z.Fetched == false)));
}
+ ///
+ /// Get all in-app notifications
+ ///
+ ///
+ [HttpGet("app-notifications")]
+ public async Task GetAppNotifications()
+ {
+ if (serverState.IsClosed)
+ return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
+ var UserId = UserIdFromContext.Id(HttpContext.Items);
+ var ret = await ct.Notification.AsNoTracking().Where(z => z.UserId == UserId).OrderByDescending(z => z.Created).ToListAsync();
+ await ct.Database.ExecuteSqlInterpolatedAsync($"update anotification set fetched={true} where userid = {UserId}");
+ return Ok(ApiOkResponse.Response(ret));
+ }
//------------