From ad0e585abed7a189b6117e9187c9afff809d1414 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Mon, 8 Apr 2019 15:55:14 +0200 Subject: Move functions to query/modify db to connection object. Makes tha API a bit nicer by asking the database rather than passing the database on to each model. Reserve models for method/functions that work on the model structs themselves. --- src/controllers/room.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/controllers/room.rs') diff --git a/src/controllers/room.rs b/src/controllers/room.rs index df77414..a203454 100644 --- a/src/controllers/room.rs +++ b/src/controllers/room.rs @@ -28,5 +28,5 @@ use rocket_contrib::{ #[get("/")] pub fn get_rooms(db: db::Connection) -> Json> { - Json(room::get_all(&db).unwrap()) + Json(db.get_rooms().unwrap()) } -- cgit v1.2.3