diff --git a/frontend/src/api/api-utils.js b/frontend/src/api/api-utils.js index 8f83a4094cd8..012f5bd0a800 100644 --- a/frontend/src/api/api-utils.js +++ b/frontend/src/api/api-utils.js @@ -31,6 +31,7 @@ const apiReq = { post: async function(url, data, getErrorText = defaultErrorText, getSuccessText) { const response = await axios.post(url, data).catch(function(error) { handleError(error, getErrorText); + return error; }); return handleResponse(response, getSuccessText); }, @@ -38,6 +39,7 @@ const apiReq = { put: async function(url, data, getErrorText = defaultErrorText, getSuccessText) { const response = await axios.put(url, data).catch(function(error) { handleError(error, getErrorText); + return error; }); return handleResponse(response, getSuccessText); }, @@ -45,6 +47,7 @@ const apiReq = { patch: async function(url, data, getErrorText = defaultErrorText, getSuccessText) { const response = await axios.patch(url, data).catch(function(error) { handleError(error, getErrorText); + return error; }); return handleResponse(response, getSuccessText); }, @@ -52,12 +55,14 @@ const apiReq = { get: async function(url, data, getErrorText = defaultErrorText) { return axios.get(url, data).catch(function(error) { handleError(error, getErrorText); + return error; }); }, delete: async function(url, data, getErrorText = defaultErrorText, getSuccessText = defaultSuccessText) { const response = await axios.delete(url, data).catch(function(error) { handleError(error, getErrorText); + return error; }); return handleResponse(response, getSuccessText); }, diff --git a/frontend/src/api/recipe.js b/frontend/src/api/recipe.js index ac4e5fb86b4e..7f039e32b7fb 100644 --- a/frontend/src/api/recipe.js +++ b/frontend/src/api/recipe.js @@ -35,9 +35,11 @@ export const recipeAPI = { }, async requestDetails(recipeSlug) { - let response = await apiReq.get(API_ROUTES.recipesRecipeSlug(recipeSlug)); - if (response && response.data) return response.data; - else return null; + const response = await apiReq.get(API_ROUTES.recipesRecipeSlug(recipeSlug)); + if (response.response) { + return response.response; + } + return response; }, updateImage(recipeSlug, fileObject, overrideSuccessMsg = false) { diff --git a/frontend/src/components/Recipe/ContextMenu.vue b/frontend/src/components/Recipe/ContextMenu.vue index c58a670a3031..8cde1278f38f 100644 --- a/frontend/src/components/Recipe/ContextMenu.vue +++ b/frontend/src/components/Recipe/ContextMenu.vue @@ -16,25 +16,13 @@ :top="menuTop" :nudge-top="menuTop ? '5' : '0'" allow-overflow + close-delay="125" + open-on-hover > -