on master help sign in
Resolved #32
commit32711197f9ec3e708145c1705a33dd40a556f657 authoriko <ilyakooo0@gmail.com> dateMon 29 Apr 2019, 14:11 (7 years ago) parent58bba86
1 file changed+5−5
denis/src/Data/Query.hs+5−5
denis/src/Data/Query.hs+5−5
@@ -152,7 +152,6 @@ getPostsByIdQ pIds = case idsToColumn pIds of
152152 (#ids ! #id .== #posts ! #postRowId))
153153 Nothing -> Nothing
154154
155−
156155type Limit = Word64
157156
158157isNotFalse
@@ -264,7 +263,6 @@ instance SOP.HasDatatypeInfo NamedChannelCreation
264263addUserToChannelCreate :: UserId -> NamedChannelCreationRequest -> NamedChannelCreation
265264addUserToChannelCreate uId (NamedChannelCreationRequest cName cTags cPeople) = NamedChannelCreation uId cName cTags cPeople
266265
267−
268266data NamedChannelFull = NamedChannelFull {
269267 namedChannelFullId :: NamedChannelId,
270268 namedChannelFullOwner :: UserId,
@@ -418,9 +416,11 @@ instance HasUsers Post where
418416 userSet = Set.singleton . postAuthorId
419417
420418wrapIntoUsers :: r -> Set.Set UserId -> StaticPQ (Maybe (ResponseWithUsers r))
421−wrapIntoUsers r us = do
422− pUsers <- getUsers $ Set.toList us
423− return $ ResponseWithUsers r . M.fromList . mapFirstBy userId <$> pUsers
419+wrapIntoUsers r us
420+ | Set.null us = return . Just $ ResponseWithUsers r M.empty
421+ | otherwise = do
422+ pUsers <- getUsers $ Set.toList us
423+ return $ ResponseWithUsers r . M.fromList . mapFirstBy userId <$> pUsers
424424
425425liftMaybe :: Applicative f => Maybe a -> (a -> f (Maybe b)) -> f (Maybe b)
426426liftMaybe Nothing _ = pure Nothing