Skip to content

Relations can now recurse infinitely

Compare
Choose a tag to compare
@twof twof released this 27 Oct 05:44
· 53 commits to master since this release
eb50c01

Nest your routes to your heart's content 😄

try router.crud(register: User.self, .only([.read])) { controller in
    try controller.crud(children: \.todos, .only([.read])) { childrenController in
        try childrenController.crud(siblings: \.tags, .only([.read])) { siblingsController in
            try siblingsController.crud(siblings: \.todos, .only([.read]))
        }
    }
}

produces

GET/user/:id
GET/user/:id/todo/:id
GET/user/:id/todo/:id/tag/:id
GET/user/:id/todo/:id/tag/:id/todo/:id