From a830486136432969711f31d16cf0f75be521bb2c Mon Sep 17 00:00:00 2001
From: Marco Endrizzi <me00531@surrey.ac.uk>
Date: Sun, 25 Apr 2021 17:07:13 -0700
Subject: [PATCH] Added timestamps

---
 src/components/EventForm.vue  | 4 ++--
 src/components/SignalForm.vue | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/components/EventForm.vue b/src/components/EventForm.vue
index 5c0501e..79f7bf5 100644
--- a/src/components/EventForm.vue
+++ b/src/components/EventForm.vue
@@ -144,8 +144,8 @@ export default {
         if (success) {
           // Turn place name into coordinates to save in db
           await this.geocodeLocation()
-          // Need to turn array into object before saving to db
-          this.eventData['friends'] = this.friendsObject
+          this.eventData['friends'] = this.friendsObject // turn array into object
+          this.eventData['timestamp'] = Date.now() // add timestamp
           // Save eventData object under events node in db
           this.firebaseSubmitEvent(this.eventData)
           this.$emit('submitted')
diff --git a/src/components/SignalForm.vue b/src/components/SignalForm.vue
index 8c7ae58..6b75daa 100644
--- a/src/components/SignalForm.vue
+++ b/src/components/SignalForm.vue
@@ -52,7 +52,7 @@ export default {
     submitSignal() {
       this.$refs.signalForm.validate().then(success => {
         if (success) {
-          this.firebaseSendSignal({ type: this.signalType, details: this.details })
+          this.firebaseSendSignal({ type: this.signalType, details: this.details, timestamp: Date.now() })
           this.$emit('submitted')
         }
       })
-- 
GitLab