#8 Attach tags to books

This commit is contained in:
2018-08-14 22:19:55 +03:00
parent 0333345aa3
commit 3d7f40eac9
6 changed files with 87 additions and 16 deletions

View File

@ -36,11 +36,11 @@ insertChannel username channel = do
return userId
booksChannels :: (MonadMask m, MonadIO m) => BookID -> SeldaT m [Channel]
booksChannels contentHash = fromRels <$> query q
booksChannels bookId = fromRels <$> query q
where
q = do
channelId :*: contentHash' <- select (gen bookChannels)
channelId :*: bookId' <- select (gen bookChannels)
ch@(channelId' :*: _) <- select (gen channels)
restrict (channelId .== channelId')
restrict (contentHash' .== literal contentHash)
restrict (bookId' .== literal bookId)
return ch