From 2660e7db2bd07e9443186f536076918a64da6784 Mon Sep 17 00:00:00 2001 From: Arnav Shekaran <78939786+arnard76@users.noreply.github.com> Date: Thu, 27 Jul 2023 22:58:04 +1200 Subject: [PATCH] isolating production (master) environment db with my development or legacy db environments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 😀😀 --- src/lib/exercises/CRUD/crudDB.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/exercises/CRUD/crudDB.ts b/src/lib/exercises/CRUD/crudDB.ts index f3be461..68bfac1 100644 --- a/src/lib/exercises/CRUD/crudDB.ts +++ b/src/lib/exercises/CRUD/crudDB.ts @@ -4,26 +4,26 @@ import exercises from "$lib/exercises/store.js"; import type { ExercisesData, ExerciseData } from "$lib/exercises"; function updateExercise(exerciseId: string, updatedExercise: ExerciseData) { - set(ref(database, `development-db/${exerciseId}`), updatedExercise); + set(ref(database, `production-db/${exerciseId}`), updatedExercise); } function createExercise(exercise: ExerciseData) { - push(ref(database, `development-db/`), exercise); + push(ref(database, `production-db/`), exercise); } function duplicateExercise(exercise: ExerciseData) { if (!exercise) return; - push(ref(database, `development-db/`), exercise); + push(ref(database, `production-db/`), exercise); } function deleteExercise(exerciseId: string) { if (!exerciseId) return; - remove(ref(database, `development-db/${exerciseId}`)); + remove(ref(database, `production-db/${exerciseId}`)); } function streamExercises() { - return onValue(ref(database, `development-db/`), (snapshot) => { + return onValue(ref(database, `production-db/`), (snapshot) => { const exerciseData: ExercisesData = snapshot.val(); console.log("exercises data:", exerciseData); exercises.syncWithDatabase(exerciseData);