mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-09 03:04:54 -04:00
fix unauthorized recipe (#499)
This commit is contained in:
parent
0e42f7407d
commit
562cea341b
@ -36,7 +36,8 @@ export const recipeAPI = {
|
||||
|
||||
async requestDetails(recipeSlug) {
|
||||
let response = await apiReq.get(API_ROUTES.recipesRecipeSlug(recipeSlug));
|
||||
return response.data;
|
||||
if (response && response.data) return response.data;
|
||||
else return null;
|
||||
},
|
||||
|
||||
updateImage(recipeSlug, fileObject, overrideSuccessMsg = false) {
|
||||
|
@ -193,6 +193,7 @@ export default {
|
||||
}
|
||||
|
||||
this.recipeDetails = await api.recipes.requestDetails(this.currentRecipe);
|
||||
if (!this.recipeDetails) router.push(`/login`);
|
||||
this.skeleton = false;
|
||||
},
|
||||
getImage(slug) {
|
||||
|
@ -27,7 +27,8 @@ export const recipeRoutes = [
|
||||
meta: {
|
||||
title: async route => {
|
||||
const recipe = await api.recipes.requestDetails(route.params.recipe);
|
||||
return recipe.name;
|
||||
if (recipe && recipe.name) return recipe.name;
|
||||
else return null;
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user