Skip to content

Commit

Permalink
Add PATCH to router and controler
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof-Cieslak committed Dec 28, 2017
1 parent f5e992f commit 35fd57d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Saturn/Controler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ module Controler =
POST [
if state.Create.IsSome then yield route "/" (fun nxt ctx -> state.Create.Value(nxt,ctx))
]
//TODO: Add Patch
PATCH [
if state.Create.IsSome then yield route "/" (fun nxt ctx -> state.Create.Value(nxt,ctx))
]
PUT [
if state.Update.IsSome then
match typ with
Expand Down
8 changes: 8 additions & 0 deletions src/Saturn/Router.fs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Saturn

open Giraffe.HttpHandlers
module Router =

open Giraffe.HttpHandlers
Expand Down Expand Up @@ -78,6 +79,8 @@ module Router =

let gets, getsf = generateRoutes RouteType.Get
let posts, postsf = generateRoutes RouteType.Post
let pathces, patchesf = generateRoutes RouteType.Patch

let puts, putsf = generateRoutes RouteType.Put
let deletes, deletesf = generateRoutes RouteType.Put

Expand Down Expand Up @@ -106,6 +109,11 @@ module Router =
yield! postsf
yield! forwards
]
yield PATCH [
yield! pathces
yield! patchesf
yield! forwards
]
yield PUT [
yield! puts
yield! putsf
Expand Down

0 comments on commit 35fd57d

Please sign in to comment.