working on rust side

This commit is contained in:
2019-02-13 16:01:24 +01:00
parent 8c89b9c059
commit 3ee9533faf
4 changed files with 108 additions and 9 deletions

View File

@@ -38,6 +38,14 @@ pub mod recipes {
.execute(conn)
.is_ok()
}
pub fn get(conn: &SqliteConnection, recipe_id: i32) -> Option<Recipe> {
use self::schema::recipes::dsl::*;
recipes.filter(id.eq(recipe_id))
.first(conn)
.ok()
}
}
pub mod ingredients {