fix: methods dont carry data

This commit is contained in:
Orion Kindel
2024-12-01 17:21:41 -06:00
parent 15e15aa921
commit 38cd701737
6 changed files with 127 additions and 130 deletions

View File

@@ -61,10 +61,10 @@ spec = describe "Parts" do
}
a <-
extractRequestParts
@(Patch ((Path ("users" / Int) _) /\ Json { firstName :: String }))
@(Patch /\ (Path ("users" / Int) _) /\ Json { firstName :: String })
req <#> lmap (error <<< show) >>= liftEither >>= liftMaybe
(error "was nothing")
a `shouldEqual` Patch (Path 12 /\ Json { firstName: "henry" })
a `shouldEqual` (Patch /\ Path 12 /\ Json { firstName: "henry" })
describe "Path" do
it "matches a route matching literal" do
@@ -231,8 +231,8 @@ spec = describe "Parts" do
{ address: "127.0.0.1", port: 81 }
, method: POST
}
a <- extractRequestParts @(Post (Json { foo :: Int, bar :: String })) req
a <- extractRequestParts @(Post /\ Json { foo :: Int, bar :: String }) req
<#> lmap (error <<< show)
>>= liftEither
>>= liftMaybe (error "was nothing")
a `shouldEqual` Post (Json { foo: 123, bar: "abc" })
a `shouldEqual` (Post /\ Json { foo: 123, bar: "abc" })