mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-03 21:37:49 -05:00
Switches to named GET Parameter for servings
This commit is contained in:
@@ -394,7 +394,7 @@ export default {
|
||||
methods: {
|
||||
|
||||
getRecipeURL: function (recipe, servings) {
|
||||
return this.resolveDjangoUrl("view_recipe",`${recipe.id}-${servings}`)
|
||||
return this.resolveDjangoUrl("view_recipe",`${recipe.id}?servings=${servings}`)
|
||||
},
|
||||
|
||||
openRecipe: function (recipe, servings) {
|
||||
|
||||
@@ -321,7 +321,8 @@ export default {
|
||||
|
||||
|
||||
if (this.recipe.image === null) this.printReady()
|
||||
if (window.RECIPE_SERVINGS && window.RECIPE_SERVINGS !== "None") {
|
||||
window.RECIPE_SERVINGS = Number(window.RECIPE_SERVINGS)
|
||||
if (window.RECIPE_SERVINGS && ! isNaN(window.RECIPE_SERVINGS)) {
|
||||
//I am not sure this is the best way. This overwrites our servings cache, which may not be intended?
|
||||
this.servings = window.RECIPE_SERVINGS
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user