1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-04 21:15:22 +02:00

Feature/improve error message on scrape (#476)

* add better feedback on failed scrape

* fix json download link

* add better recipe parser

* dump deps

* fix force open on mobile

* formatting

* rewrite scraper to use new library

* fix failing tests

* bookmarklet support

* bookmarklet instructions

* recipes changelog

Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden 2021-06-09 13:04:54 -08:00 committed by GitHub
parent 3702331630
commit a78fbea711
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 658 additions and 15582 deletions

View file

@ -12,6 +12,7 @@ const recipeURLs = {
allRecipesByCategory: prefix + "category",
create: prefix + "create",
createByURL: prefix + "create-url",
testParseURL: prefix + "test-scrape-url",
recipe: slug => prefix + slug,
update: slug => prefix + slug,
delete: slug => prefix + slug,
@ -29,11 +30,8 @@ export const recipeAPI = {
* @returns {string} Recipe Slug
*/
async createByURL(recipeURL) {
const response = await apiReq.post(
recipeURLs.createByURL,
{ url: recipeURL },
() => i18n.t("recipe.recipe-creation-failed"),
() => i18n.t("recipe.recipe-created")
const response = await apiReq.post(recipeURLs.createByURL, { url: recipeURL }, false, () =>
i18n.t("recipe.recipe-created")
);
store.dispatch("requestRecentRecipes");
@ -186,4 +184,9 @@ export const recipeAPI = {
const response = await apiReq.delete(API_ROUTES.recipesSlugCommentsId(slug, id));
return response.data;
},
async testScrapeURL(url) {
const response = await apiReq.post(recipeURLs.testParseURL, { url: url });
return response.data;
},
};