Closed grosch closed 4 years ago
Provides convenience methods for returning newly created objects. Sets the status code to 201 (Created) and includes the Location header.
func create(req: Request) throws -> EventLoopFuture<Response> { let todo = try req.content.decode(Todo.self) return todo.create(on: req.db).flatMapThrowing { try .created(todo, for: req) } }
Hold off on this...I'm making some other changes here.
Resubmitting a new request
Provides convenience methods for returning newly created objects. Sets the status code to 201 (Created) and includes the Location header.