diff --git a/php/controller/like-controller.php b/php/controller/like-controller.php new file mode 100644 index 0000000..d0d9a95 --- /dev/null +++ b/php/controller/like-controller.php @@ -0,0 +1,42 @@ +toggleLike($articleId, $userEmail); + + header("Location: ../../index.php?pfad=showArticle&id=" . $articleId); + exit(); + + } catch (NotFoundException $e) { + $_SESSION["message"] = "missing_id"; + header("Location: ../../index.php"); + exit(); + } catch (Exception $e) { + $_SESSION["message"] = "internal_error"; + header("Location: ../../index.php"); + exit(); + } +} else { + $_SESSION["message"] = "missing_id"; + header("Location: ../../index.php"); + exit(); +} + +?> \ No newline at end of file