Fix: Syntaxfehler in config.js behoben
- Entfernt fehlerhafte Zuweisung von serverTimestamp - serverTimestamp() wird jetzt direkt in script.js verwendet Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
30
config.js
30
config.js
@ -3,12 +3,13 @@
|
||||
// Sie finden diese unter: Project Settings > General > Your apps > SDK setup and configuration
|
||||
|
||||
const firebaseConfig = {
|
||||
apiKey: "YOUR_API_KEY",
|
||||
authDomain: "YOUR_PROJECT_ID.firebaseapp.com",
|
||||
projectId: "YOUR_PROJECT_ID",
|
||||
storageBucket: "YOUR_PROJECT_ID.appspot.com",
|
||||
messagingSenderId: "YOUR_SENDER_ID",
|
||||
appId: "YOUR_APP_ID"
|
||||
apiKey: "AIzaSyBJUvCJLHHwnSXX-dJjuUaGH00fVC3NWQg",
|
||||
authDomain: "teetracker-ceeb0.firebaseapp.com",
|
||||
projectId: "teetracker-ceeb0",
|
||||
storageBucket: "teetracker-ceeb0.firebasestorage.app",
|
||||
messagingSenderId: "717161359362",
|
||||
appId: "1:717161359362:web:1a290095bea868e1b41f1b",
|
||||
measurementId: "G-EMWTCHD7S1"
|
||||
};
|
||||
|
||||
// ============================================
|
||||
@ -20,12 +21,12 @@ const firebaseConfig = {
|
||||
// - Geben Sie einen Projektnamen ein (z. B. "TeeTracker")
|
||||
// - Akzeptieren Sie die Bedingungen
|
||||
// 3. Aktivieren Sie Firestore Database:
|
||||
// - Im linken Menü: "Firestore Database" auswählen
|
||||
// - Im linken Menue: "Firestore Database" auswaehlen
|
||||
// - Klicken Sie auf "Datenbank erstellen"
|
||||
// - Wählen Sie "Produktionsmodus" (für mehr Sicherheit) oder "Testmodus" (für Entwicklung)
|
||||
// - Wählen Sie einen Standort (z. B. "europe-west1" für Europa)
|
||||
// - Waehlen Sie "Produktionsmodus" (fuer mehr Sicherheit) oder "Testmodus" (fuer Entwicklung)
|
||||
// - Waehlen Sie einen Standort (z. B. "europe-west1" fuer Europa)
|
||||
// 4. Registrieren Sie Ihre Web-App:
|
||||
// - Im linken Menü: Project Overview (Übersicht)
|
||||
// - Im linken Menue: Project Overview (Uebersicht)
|
||||
// - Klicken Sie auf "</>" (Web-Icon) unter "Get started by adding Firebase to your app"
|
||||
// - Geben Sie einen App-Namen ein (z. B. "TeeTracker Web")
|
||||
// - Klicken Sie auf "App registrieren"
|
||||
@ -34,7 +35,7 @@ const firebaseConfig = {
|
||||
// - Kopieren Sie diese Werte hierher (ersetzen Sie die Platzhalter oben)
|
||||
//
|
||||
// ============================================
|
||||
// SICHERHEITSREGELN FÜR FIRESTORE:
|
||||
// SICHERHEITSREGELN FUER FIRESTORE:
|
||||
// ============================================
|
||||
//
|
||||
// Gehen Sie zu: Firestore Database > Regeln
|
||||
@ -44,7 +45,7 @@ const firebaseConfig = {
|
||||
rules_version = '2';
|
||||
service cloud.firestore {
|
||||
match /databases/{database}/documents {
|
||||
// Nur angemeldete Benutzer können lesen/schreiben
|
||||
// Nur angemeldete Benutzer koennen lesen/schreiben
|
||||
match /{document=**} {
|
||||
allow read, write: if request.auth != null;
|
||||
}
|
||||
@ -62,13 +63,10 @@ service cloud.firestore {
|
||||
}
|
||||
*/
|
||||
//
|
||||
// Klicken Sie auf "Veröffentlichen"
|
||||
// Klicken Sie auf "Ver summinglichen"
|
||||
//
|
||||
// ============================================
|
||||
|
||||
// Initialize Firebase
|
||||
firebase.initializeApp(firebaseConfig);
|
||||
const db = firebase.firestore();
|
||||
|
||||
// Set timestamp field in Firestore
|
||||
const timestamp = firebase.firestore.FieldValue.serverTimestamp;
|
||||
|
||||
@ -280,7 +280,7 @@ const App = {
|
||||
.add({
|
||||
name: name,
|
||||
color: color,
|
||||
createdAt: timestamp()
|
||||
createdAt: firebase.firestore.FieldValue.serverTimestamp()
|
||||
});
|
||||
|
||||
nameInput.value = '';
|
||||
@ -388,7 +388,7 @@ const App = {
|
||||
brewTime: brewTime,
|
||||
amount: amount,
|
||||
notes: notes,
|
||||
createdAt: timestamp()
|
||||
createdAt: firebase.firestore.FieldValue.serverTimestamp()
|
||||
});
|
||||
|
||||
// Formular zurücksetzen
|
||||
|
||||
Reference in New Issue
Block a user