From a056a8a92137e660ba369c9b6016a4808a17bfa1 Mon Sep 17 00:00:00 2001 From: Laurent <58115082+naaturel@users.noreply.github.com> Date: Tue, 18 Mar 2025 13:48:37 +0100 Subject: [PATCH] Events are now fetch from the API --- .../letsmeet/controllers/EventController.java | 2 +- front/.env.development | 1 + front/.env.production | 1 + front/src/components/Button.vue | 3 +- front/src/components/InputField.vue | 10 +++++- front/src/config/ApiConfig.ts | 8 +++++ front/src/models/Event.ts | 32 ++++++++++++++++++ front/src/models/Participant.ts | 13 ++++++++ front/src/requests/EventRequests.ts | 33 +++++++++++++++++++ front/src/stores/EventStore.ts | 18 ++++++++++ front/src/views/JoinView.vue | 13 ++++++-- 11 files changed, 129 insertions(+), 5 deletions(-) create mode 100644 front/.env.development create mode 100644 front/.env.production create mode 100644 front/src/config/ApiConfig.ts create mode 100644 front/src/models/Event.ts create mode 100644 front/src/models/Participant.ts create mode 100644 front/src/requests/EventRequests.ts create mode 100644 front/src/stores/EventStore.ts diff --git a/back/src/main/java/be/naaturel/letsmeet/controllers/EventController.java b/back/src/main/java/be/naaturel/letsmeet/controllers/EventController.java index 06f4925..66245c0 100644 --- a/back/src/main/java/be/naaturel/letsmeet/controllers/EventController.java +++ b/back/src/main/java/be/naaturel/letsmeet/controllers/EventController.java @@ -18,7 +18,7 @@ public class EventController { } - @GetMapping({"/event", "/event/{token}"}) + @GetMapping({"/event/{token}/", "/event/{token}"}) public ResponseEntity get(@PathVariable String token){ try{ diff --git a/front/.env.development b/front/.env.development new file mode 100644 index 0000000..6af39e6 --- /dev/null +++ b/front/.env.development @@ -0,0 +1 @@ +VITE_API_URL = http://127.0.0.1:5001/ \ No newline at end of file diff --git a/front/.env.production b/front/.env.production new file mode 100644 index 0000000..8459e5c --- /dev/null +++ b/front/.env.production @@ -0,0 +1 @@ +VITE_API_URL = \ No newline at end of file diff --git a/front/src/components/Button.vue b/front/src/components/Button.vue index 6815b81..2870dbc 100644 --- a/front/src/components/Button.vue +++ b/front/src/components/Button.vue @@ -2,12 +2,13 @@ const props = defineProps<{ description: string; + action?: Function; }>();