From e15d3643a06f1a54c03bc5eaa1eefa1a2846d7b5 Mon Sep 17 00:00:00 2001 From: Alex Reilly Date: Sat, 27 Oct 2018 00:58:55 -0700 Subject: [PATCH] Removed trys --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 20cced3..2fc6836 100644 --- a/README.md +++ b/README.md @@ -71,8 +71,8 @@ DELETE /account/:id Say you had a model `User`, which was the parent of another model `Todo`. If you'd like routes to expose all `Todo`s that belong to a specific `User`, you can do something like this. ```swift -try router.crud(register: User.self) { controller in - try controller.crud(children: \.todos) +router.crud(register: User.self) { controller in + controller.crud(children: \.todos) } ``` @@ -95,17 +95,17 @@ DELETE /user/:id/todo/:id // deletes the Todo with :id belonging to the User w within the supplied closure, you can also expose routes for related `Parent`s and `Sibling`s ```swift -try controller.crud(children: \.todos) -try controller.crud(parent: \.todos) -try controller.crud(siblings: \.todos) +controller.crud(children: \.todos) +controller.crud(parent: \.todos) +controller.crud(siblings: \.todos) ``` #### Including or Excluding Specific Routes If you'd like to register a `Model`, but you don't want every route to be available, you can specify the ones you want, or exclude the ones you don't. ```swift -try router.crud(register: Todo.self, .except([.create, .delete])) { controller in - try controller.crud(parent: \.owner, .only([.read])) +router.crud(register: Todo.self, .except([.create, .delete])) { controller in + controller.crud(parent: \.owner, .only([.read])) } ```