From 7424650ab6f402277435dd366f82c73c83f8cde6 Mon Sep 17 00:00:00 2001 From: Matthew Huntington Date: Tue, 28 Mar 2023 21:03:03 -0400 Subject: [PATCH] submit session data works --- src/components/timer.vue | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/components/timer.vue b/src/components/timer.vue index e8c2be2..8282185 100644 --- a/src/components/timer.vue +++ b/src/components/timer.vue @@ -18,10 +18,20 @@ methods: { submit(event){ event.preventDefault(); - console.log(this.description); - console.log(this.seconds); - console.log(this.comments); - console.log(this.practice_category_id); + const reqBody = { + description:this.description, + seconds: this.totalSeconds, + practice_category_id: this.practice_category_id + } + + if(this.comments){ + reqBody.comments = this.comments + } + + axios.post( + import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'sessions', + reqBody + ); }, start(event){ this.startTime = Date.now();