From f5135eb85adb572e83830262d3de85eb7fc462d3 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Sun, 12 Nov 2023 17:09:18 +0100 Subject: [PATCH] additem with events --- web/html/addevent.html | 6 ++--- web/js/addItem.js | 54 ++++++++++++++++++++++++++++++++---------- web/js/geosearch.js | 2 +- 3 files changed, 46 insertions(+), 16 deletions(-) diff --git a/web/html/addevent.html b/web/html/addevent.html index a29e2e1..030b8ce 100644 --- a/web/html/addevent.html +++ b/web/html/addevent.html @@ -183,8 +183,7 @@
Lieu - -
+
Date de début de l'évènement @@ -213,6 +212,7 @@ - + + \ No newline at end of file diff --git a/web/js/addItem.js b/web/js/addItem.js index 519548b..f5470cf 100644 --- a/web/js/addItem.js +++ b/web/js/addItem.js @@ -5,10 +5,25 @@ pathURL = document.location.pathname.split("/")[document.location.pathname.split document.getElementById("addUser").addEventListener("click", function(){ - var updateProfil = ["username", "email", "firstName", "birth", "password"]; + switch (pathURL){ + case "users": + var updateProfil = ["username", "email", "firstName", "birth", "password"]; + break; + case "events": + var updateProfil = ["name", "place", "start_date", "end_date"]; + break; + default: + var updateProfil = [] + break; + } var updateOk = true; for (var i=0; i