lila/app/controllers/Notify.scala

20 lines
463 B
Scala
Raw Normal View History

package controllers
import lila.app._
import lila.notify.Notification.Notifies
2019-12-04 16:39:16 -07:00
final class Notify(env: Env) extends LilaController(env) {
2020-05-05 22:11:15 -06:00
def recent(page: Int) =
Auth { implicit ctx => me =>
XhrOrRedirectHome {
env.notifyM.api
.getNotificationsAndCount(Notifies(me.id), page) map env.notifyM.jsonHandlers.apply map JsonOk
2021-03-26 14:54:26 -06:00
}
}
2021-09-26 09:10:22 -06:00
2021-09-29 08:10:37 -06:00
def clear = Auth { implicit ctx => me =>
env.notifyM.api.remove(Notifies(me.id))
}
}