From f236de50a7212dd7d9e1ebe89096283f44b59846 Mon Sep 17 00:00:00 2001 From: Linard Schwendener Date: Fri, 23 Sep 2022 17:24:45 +0200 Subject: [PATCH] Revert "Removed unused index.php" This reverts commit 597a24329e5d3a5ca5c8bf0448d4ead8312a0596. --- docker/data/Recipes/problem/recipe.json | 2 +- lib/src/services/authentication_provider.dart | 3 ++- lib/src/services/categories_provider.dart | 2 +- lib/src/services/category_recipes_short_provider.dart | 2 +- lib/src/services/recipe_provider.dart | 8 ++++---- lib/src/services/recipes_short_provider.dart | 2 +- lib/src/services/version_provider.dart | 2 +- .../authentication_cached_network_recipe_image.dart | 2 +- 8 files changed, 12 insertions(+), 11 deletions(-) diff --git a/docker/data/Recipes/problem/recipe.json b/docker/data/Recipes/problem/recipe.json index dc5ca971..7334fcd4 100644 --- a/docker/data/Recipes/problem/recipe.json +++ b/docker/data/Recipes/problem/recipe.json @@ -27,5 +27,5 @@ "dateModified": "2021-10-30T16:02:47+0000", "dateCreated": "2021-10-30T16:02:22+0000", "printImage": false, - "imageUrl": "\/apps\/cookbook\/recipes\/128051\/image?size=full" + "imageUrl": "\/index.php\/apps\/cookbook\/recipes\/128051\/image?size=full" } diff --git a/lib/src/services/authentication_provider.dart b/lib/src/services/authentication_provider.dart index 0eeac8c5..aeee643d 100644 --- a/lib/src/services/authentication_provider.dart +++ b/lib/src/services/authentication_provider.dart @@ -168,7 +168,8 @@ class AuthenticationProvider { String basicAuth, bool isSelfSignedCertificate, ) async { - String urlAuthCheck = serverUrl + '/apps/cookbook/api/v1/categories'; + String urlAuthCheck = + serverUrl + '/index.php/apps/cookbook/api/v1/categories'; dio.Response response; try { diff --git a/lib/src/services/categories_provider.dart b/lib/src/services/categories_provider.dart index 9a180ab7..21e46a41 100644 --- a/lib/src/services/categories_provider.dart +++ b/lib/src/services/categories_provider.dart @@ -11,7 +11,7 @@ class CategoriesProvider { UserRepository().getCurrentAppAuthentication(); final String url = - "${appAuthentication.server}/apps/cookbook/api/v1/categories"; + "${appAuthentication.server}/index.php/apps/cookbook/api/v1/categories"; // Parse categories try { diff --git a/lib/src/services/category_recipes_short_provider.dart b/lib/src/services/category_recipes_short_provider.dart index 9dd946dd..499b01b6 100644 --- a/lib/src/services/category_recipes_short_provider.dart +++ b/lib/src/services/category_recipes_short_provider.dart @@ -19,7 +19,7 @@ class CategoryRecipesShortProvider { ? "_" : category; // Mapping from * to _ for recipes without a category! url = - "${appAuthentication.server}/apps/cookbook/api/v1/category/$category"; + "${appAuthentication.server}/index.php/apps/cookbook/api/v1/category/$category"; } // Parse categories diff --git a/lib/src/services/recipe_provider.dart b/lib/src/services/recipe_provider.dart index 7258e891..08619ade 100644 --- a/lib/src/services/recipe_provider.dart +++ b/lib/src/services/recipe_provider.dart @@ -12,7 +12,7 @@ class RecipeProvider { UserRepository().getCurrentAppAuthentication(); final String url = - "${appAuthentication.server}/apps/cookbook/api/v1/recipes/$id"; + "${appAuthentication.server}/index.php/apps/cookbook/api/v1/recipes/$id"; // Parse categories try { String contents = await Network().get(url); @@ -29,7 +29,7 @@ class RecipeProvider { try { final String url = - "${appAuthentication.server}/apps/cookbook/api/v1/recipes/${recipe.id}"; + "${appAuthentication.server}/index.php/apps/cookbook/api/v1/recipes/${recipe.id}"; var response = await client.put(url, data: recipe.toJson(), options: new Options( @@ -50,7 +50,7 @@ class RecipeProvider { try { var response = await client.post( - "${appAuthentication.server}/apps/cookbook/api/v1/recipes", + "${appAuthentication.server}/index.php/apps/cookbook/api/v1/recipes", data: recipe.toJson(), options: new Options( contentType: "application/json;charset=UTF-8", @@ -68,7 +68,7 @@ class RecipeProvider { try { var response = await client.post( - "${appAuthentication.server}/apps/cookbook/api/v1/import", + "${appAuthentication.server}/index.php/apps/cookbook/api/v1/import", data: {"url": url}, options: new Options( contentType: "application/json;charset=UTF-8", diff --git a/lib/src/services/recipes_short_provider.dart b/lib/src/services/recipes_short_provider.dart index d21c0492..21e33c6b 100644 --- a/lib/src/services/recipes_short_provider.dart +++ b/lib/src/services/recipes_short_provider.dart @@ -10,7 +10,7 @@ class RecipesShortProvider { AppAuthentication appAuthentication = UserRepository().getCurrentAppAuthentication(); - final String url = "${appAuthentication.server}/apps/cookbook/api/v1/recipes"; + final String url = "${appAuthentication.server}/index.php/apps/cookbook/api/v1/recipes"; try { String contents = await Network().get(url); return RecipeShort.parseRecipesShort(contents); diff --git a/lib/src/services/version_provider.dart b/lib/src/services/version_provider.dart index 549f0e26..e37f77da 100644 --- a/lib/src/services/version_provider.dart +++ b/lib/src/services/version_provider.dart @@ -14,7 +14,7 @@ class VersionProvider { UserRepository().getCurrentAppAuthentication(); var response = await appAuthentication.authenticatedClient - .get("${appAuthentication.server}/apps/cookbook/api/version"); + .get("${appAuthentication.server}/index.php/apps/cookbook/api/version"); if (response.statusCode == 200 && !response.data.toString().startsWith("")) { diff --git a/lib/src/widget/authentication_cached_network_recipe_image.dart b/lib/src/widget/authentication_cached_network_recipe_image.dart index 465cac60..51110f87 100644 --- a/lib/src/widget/authentication_cached_network_recipe_image.dart +++ b/lib/src/widget/authentication_cached_network_recipe_image.dart @@ -28,7 +28,7 @@ class AuthenticationCachedNetworkRecipeImage extends StatelessWidget { return AuthenticationCachedNetworkImage( url: - '${appAuthentication.server}/apps/cookbook/api/v1/recipes/$recipeId/image?size=$settings', + '${appAuthentication.server}/index.php/apps/cookbook/api/v1/recipes/$recipeId/image?size=$settings', width: width, height: height, boxFit: boxFit,