packages feed

yesod-transloadit 0.6.0.0 → 0.7.0.0

raw patch · 3 files changed

+5/−5 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- Yesod.Transloadit: nthStepResult :: AsValue s => Int -> Text -> Maybe s -> Maybe StepResult
+ Yesod.Transloadit: nthStepResult :: AsValue s => Maybe s -> Text -> Int -> Maybe StepResult

Files

src/Yesod/Transloadit.hs view
@@ -185,9 +185,9 @@         toURI = parseURI . unpack  -- | Helper method to pull the nth @StepResult@ for a given key from the Transloadit response-nthStepResult :: AsValue s => Int -> Text -> Maybe s -> Maybe StepResult-nthStepResult _ _ Nothing = Nothing-nthStepResult i k (Just u) = u ^? AL.key "results"+nthStepResult :: AsValue s => Maybe s -> Text -> Int -> Maybe StepResult+nthStepResult Nothing _ _ = Nothing+nthStepResult (Just u) k i = u ^? AL.key "results"                              . AL.key k                              . nth i                              . _Object
test/Tests.hs view
@@ -64,7 +64,7 @@              where results = fromList [("foo", stepResults)]                    stepResults = [fromList [("id","<id>"), ("name", "n"), ("basename", "b"), ("ext", "e"), ("mime", "text/plain"), ("field", "f"), ("url", "http://foo.com"), ("ssl_url", "https://foo.com")]] -sampleResult = fromJust $ nthStepResult 0 "foo" (return $ encode sampleDict)+sampleResult = fromJust $ nthStepResult (return $ encode sampleDict) "foo" 0  formGenSpecs :: Spec formGenSpecs = yesodSpec Test $ do
yesod-transloadit.cabal view
@@ -1,5 +1,5 @@ name:                yesod-transloadit-version:             0.6.0.0+version:             0.7.0.0 synopsis:            Transloadit support for Yesod description:         Drop in Transloadit capabilites for Yesod web apps license:             MIT