couchdb-conduit 0.2.1 → 0.2.1.1
raw patch · 3 files changed
+7/−8 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- couchdb-conduit.cabal +1/−1
- src/Database/CouchDB/Conduit/DB.hs +1/−1
- src/Database/CouchDB/Conduit/Design.hs +5/−6
couchdb-conduit.cabal view
@@ -1,5 +1,5 @@ name: couchdb-conduit-version: 0.2.1 +version: 0.2.1.1 cabal-version: >= 1.8 build-type: Simple stability: Experimental
src/Database/CouchDB/Conduit/DB.hs view
@@ -94,7 +94,7 @@ -> [B.ByteString] -- ^ Readers names -> ResourceT m () couchSecureDB p adminRoles adminNames readersRoles readersNames = - couch HT.methodPut (`B.append` B.append "/" p) [] [] + couch HT.methodPut (const $ p `B.append` "/_security") [] [] reqBody protect' >> return () where
src/Database/CouchDB/Conduit/Design.hs view
@@ -21,7 +21,8 @@ import qualified Data.Aeson.Types as AT import Database.CouchDB.Conduit (MonadCouch, CouchError, Path, mkPath, Revision) -import Database.CouchDB.Conduit.Internal.Doc (couchGetWith, couchPutWith) +import Database.CouchDB.Conduit.Internal.Doc (couchGetWith, + couchPutWith_, couchPutWith') -- | Put view in design document if it not exists. If design document does -- not exist, it will be created. @@ -56,11 +57,9 @@ -> ResourceT m Revision couchViewPutInt prot designName viewName mapF reduceF = do -- Get design or empty object - (rev, A.Object d) <- getDesignDoc path - let extractedView = extractViews d - if extractedView /= M.empty && prot - then return rev - else couchPutWith A.encode path rev [] $ inferViews (purge_ d) + (_, A.Object d) <- getDesignDoc path + if prot then couchPutWith_ A.encode path [] $ inferViews (purge_ d) + else couchPutWith' A.encode path [] $ inferViews (purge_ d) where path = designDocPath designName inferViews d = A.Object $ M.insert "views" (addView d) d