Switches to named GET Parameter for servings

This commit is contained in:
Patrick Magauran
2024-02-13 20:59:04 -05:00
parent a9a3dd6e51
commit cf190734b2
4 changed files with 6 additions and 6 deletions

View File

@@ -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) {

View File

@@ -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 {