From 3475f403deda536b8289576802f29fe195dc3c95 Mon Sep 17 00:00:00 2001 From: Valter Schutz Date: Sat, 2 Mar 2024 15:21:25 +0100 Subject: [PATCH] Add 'addedByUID' field to matches --- src/App.js | 2 -- src/Entries.js | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/App.js b/src/App.js index 1fcef9d..13a9ee8 100644 --- a/src/App.js +++ b/src/App.js @@ -7,8 +7,6 @@ import { useState } from 'react'; import LoggedIn from './LoggedIn'; import LoggedOut from './LoggedOut'; -// TODO: when adding a match, save who added the match - const firebaseConfig = { apiKey: "AIzaSyB0fVnzGA6ikLwft4VdHt8yrfrgqOKjI7M", authDomain: "pingis-app.firebaseapp.com", diff --git a/src/Entries.js b/src/Entries.js index 5bbba81..35ed7d0 100644 --- a/src/Entries.js +++ b/src/Entries.js @@ -91,7 +91,8 @@ function Entries() { player2: doc(db, 'players', playersSnapshot.docs[player2Index].id), player1Score: player1Score, player2Score: player2Score, - when: serverTimestamp() + when: serverTimestamp(), + addedByUID: auth.currentUser.uid, }) setSubmitIsLoading(false) // Allow removing of doc for 10 seconds afterwards (if undo is enabled in settings)