use crate::structures::{RecipeForm, Tag}; use rocket::form::Form; #[get("/test")] pub fn test() -> String { return "Hello! :3".to_string(); } pub fn parse_tags(tags: String) -> Vec { let split: Vec<&str> = tags.split(",").collect(); let mut tags_vec: Vec = Vec::new(); for i in split { tags_vec.push(Tag::new(i.replace(" ", "").replace("#", ""))); } return tags_vec; } #[post("/new-recipe", data = "")] pub fn new_recipe(recipe: Form) -> String { return recipe.recipe_name.to_owned(); }