diff --git a/php/controller/index-controller.php b/php/controller/index-controller.php index 0dc6c25..52efb03 100644 --- a/php/controller/index-controller.php +++ b/php/controller/index-controller.php @@ -1,32 +1,41 @@ findUser($email) !== null) { + $availableUserEmails[] = $email; + } + } + + if (!empty($availableUserEmails)) { + $newArticles = seedDummyArticles($articleManager, $availableUserEmails); + } else { + throw new Exception("Keine gültigen Benutzer für das Artikel-Seeding gefunden."); + } } catch (Exception $e) { $_SESSION["message"] = "database_error"; + error_log("Seeding-Fehler: " . $e->getMessage()); } - -?> \ No newline at end of file +?> diff --git a/php/dummys/articleDummys.php b/php/dummys/articleDummys.php index e66be8d..2a0668c 100644 --- a/php/dummys/articleDummys.php +++ b/php/dummys/articleDummys.php @@ -1,9 +1,11 @@