feat: record activity when checking off a household chore
This commit is contained in:
@@ -49,9 +49,13 @@ instance (DB :> es, IOE :> es) => HyperView DashboardPage es where
|
|||||||
(h : _) -> do
|
(h : _) -> do
|
||||||
dash <- getDashboard (unHouseholdId (householdId h)) today
|
dash <- getDashboard (unHouseholdId (householdId h)) today
|
||||||
pure $ hyper DashboardPage $ pageLayout us $ dashboardView dash
|
pure $ hyper DashboardPage $ pageLayout us $ dashboardView dash
|
||||||
update (CheckOff _oid) = do
|
update (CheckOff oid) = do
|
||||||
-- TODO: wire up to activity form
|
mUser <- lookupSession @UserSession
|
||||||
update RefreshDashboard
|
case mUser of
|
||||||
|
Nothing -> pure (el "Not authenticated")
|
||||||
|
Just us -> do
|
||||||
|
_ <- recordActivity (unOccurrenceId oid) (UserId (usUserId us)) ActivityCompleted Nothing False
|
||||||
|
update RefreshDashboard
|
||||||
|
|
||||||
dashboardView :: Dashboard -> View DashboardPage ()
|
dashboardView :: Dashboard -> View DashboardPage ()
|
||||||
dashboardView dash = do
|
dashboardView dash = do
|
||||||
|
|||||||
Reference in New Issue
Block a user