Last active
August 29, 2015 14:14
-
-
Save nitindhar7/2fb7c316c52243178025 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object FetchNotifications | |
extends ActionTransformer[AuthRequest, NotificationRequest] { | |
def transform[A](request: AuthRequest[A]) = Future { | |
request.user.map { user => | |
NotificationRequest[A](Some(user), findNotificationsByUser(user), request) | |
} getOrElse { | |
NotificationRequest[A](None, None, request) | |
} | |
} | |
} | |
case class NotificationRequest[A]( | |
val user: Option[User], | |
val notifications: Option[List[Notification]], | |
request: Request[A] | |
) extends WrappedRequest(request) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment