From d294253a270ad62759b8de2b666f90ffc0ae0de9 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Mon, 21 Aug 2023 21:12:21 +0200 Subject: [PATCH] Sitze und Rechtsformen aus Zefix API --- api/index.php | 4 +--- api/zefixAPI.php | 4 +--- index.php | 4 +++- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/api/index.php b/api/index.php index 8d2686a..9a9b50b 100644 --- a/api/index.php +++ b/api/index.php @@ -50,7 +50,7 @@ if (isset($_POST['sitze']) && is_array($_POST['sitze']) && count($_POST['sitze'] $response = sendAPICompanySearchRequest($username, $password, $data); // echo $response; - echo communityCSV($username, $password); + } @@ -64,6 +64,4 @@ $constructed_response = $response; //header('Content-Type: application/json'); //echo $constructed_response; - - ?> \ No newline at end of file diff --git a/api/zefixAPI.php b/api/zefixAPI.php index b5522a6..8f39769 100644 --- a/api/zefixAPI.php +++ b/api/zefixAPI.php @@ -4,6 +4,7 @@ $username = getenv("username"); $password = getenv("password"); + /** * @param string $ * @param string $ @@ -41,7 +42,6 @@ echo 'Curl error: ' . curl_error($ch); } // Close cURL session curl_close($ch); - echo $response; return $response; } @@ -81,7 +81,6 @@ function sendAPICommunityRequest(string $username, string $password): string|boo function communityCSV(string $username, string $password): string { $response = sendAPICommunityRequest($username, $password); - echo $response; $communityArray = json_decode($response, true); $csvOutput = 'bfsId,Kanton,Gemeindename,registryOfCommerceId\n'; // Create CSV rows @@ -138,5 +137,4 @@ function legalFormCSV(string $username, string $password): string { return $csvOutput; } -sendAPICommunityRequest($username, $password); ?> \ No newline at end of file diff --git a/index.php b/index.php index d96a710..b7972e5 100644 --- a/index.php +++ b/index.php @@ -1,3 +1,6 @@ + @@ -144,7 +147,6 @@ let communityCsvData; let legalFormsCsvData;