aboutsummaryrefslogtreecommitdiff
path: root/src/controller/ContactFormController.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/controller/ContactFormController.php')
-rw-r--r--src/controller/ContactFormController.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/controller/ContactFormController.php b/src/controller/ContactFormController.php
index 181e93c..01faa72 100644
--- a/src/controller/ContactFormController.php
+++ b/src/controller/ContactFormController.php
@@ -80,4 +80,20 @@ class ContactFormController
80 } 80 }
81 die; 81 die;
82 } 82 }
83 static public function deleteEmail(EntityManager $entityManager, array $json): void
84 {
85 $email = $entityManager->find('App\Entity\Email', $json['id']);
86 $entityManager->remove($email);
87 $entityManager->flush();
88 echo json_encode(['success' => true]);
89 die;
90 }
91 static public function toggleSensitiveEmail(EntityManager $entityManager, array $json): void
92 {
93 $email = $entityManager->find('App\Entity\Email', $json['id']);
94 $email->makeSensitive($json['checked']);
95 $entityManager->flush();
96 echo json_encode(['success' => true, 'checked' => $json['checked'], 'deletion_date' => $email->getDeletionDate()->format('d/m/Y')]);
97 die;
98 }
83} \ No newline at end of file 99} \ No newline at end of file