diff --git a/app/controllers/recipes_controller.rb b/app/controllers/recipes_controller.rb
index 55902bb..964c35f 100644
--- a/app/controllers/recipes_controller.rb
+++ b/app/controllers/recipes_controller.rb
@@ -8,6 +8,7 @@ class RecipesController < ApplicationController
def index
@criteria = ViewModels::RecipeCriteria.new(criteria_params)
@recipes = Recipe.for_criteria(@criteria).includes(:tags)
+ render json: RecipeSummarySerializer.for(@recipes, collection_name: 'recipes')
end
# GET /recipes/1
@@ -38,6 +39,7 @@ class RecipesController < ApplicationController
end
end
+ render json: RecipeSerializer.for(@recipe)
end
# POST /recipes
@@ -55,8 +57,8 @@ class RecipesController < ApplicationController
# PATCH/PUT /recipes/1
def update
ensure_owner(@recipe) do
- if @recipe.update(recipe_params)
- @recipe.touch
+ # Merge in updated_at to force the record to be dirty (in case only tags were changed)
+ if @recipe.update(recipe_params.merge(updated_at: Time.now))
render json: { success: true }
else
render json: @recipe.errors, status: :unprocessable_entity
diff --git a/app/javascript/components/AppSearchText.vue b/app/javascript/components/AppSearchText.vue
index fe1eba0..2c5b7c3 100644
--- a/app/javascript/components/AppSearchText.vue
+++ b/app/javascript/components/AppSearchText.vue
@@ -19,8 +19,9 @@ export default {
},
value: {
- required: true,
- type: Array
+ required: false,
+ type: String,
+ default: ""
}
},
diff --git a/app/javascript/components/TheRecipeList.vue b/app/javascript/components/TheRecipeList.vue
index c07283b..da5188b 100644
--- a/app/javascript/components/TheRecipeList.vue
+++ b/app/javascript/components/TheRecipeList.vue
@@ -50,7 +50,7 @@
|
- |