aboutsummaryrefslogtreecommitdiff
path: root/lib/Server/Subscribe.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Server/Subscribe.hs')
-rw-r--r--lib/Server/Subscribe.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Server/Subscribe.hs b/lib/Server/Subscribe.hs
index 8559659..5b0edb5 100644
--- a/lib/Server/Subscribe.hs
+++ b/lib/Server/Subscribe.hs
@@ -37,9 +37,9 @@ handleSubscribe dbpool subscribers (ticketId :: UUID) conn = liftIO $ WS.withPin
-- send most recent ping, if any (so we won't have to wait for movement)
runSqlWithoutLog dbpool (selectOne do
- ping <- from (table @TrainPing)
- where_ (ping ^. TrainPingTicket ==. val (coerce ticketId))
- orderBy [desc (ping ^. TrainPingTimestamp)]
+ ping <- from (table @Ping)
+ where_ (ping ^. PingTicket ==. val (Just (coerce ticketId)))
+ orderBy [desc (ping ^. PingTimestamp)]
pure ping)
<&> fmap entityVal
>>= flip whenJust (WS.sendTextData conn . A.encode)