Before starting this section, check the code in the chapter8/3/profitoro
folder. Both the Workouts
and NewWorkout
components are filled with a markup.
It doesn't work yet, but it displays something:
In this section, we are going to add workout objects to our workouts resource in the Firebase database. After that, we can finally learn how to store images using the Firebase data storage mechanism.
First, let's add Firebase bindings just like we've done for statistics and configuration objects. Open the action.js
file and find the bindFirebaseReferences
method. Here, we should add the binding for the workouts
resource. So, this method now contains three bindings:
// state/actions.js
bindFirebaseReferences: firebaseAction(({state, commit, dispatch}, user) => {
let db = firebaseApp.database()
let configRef = db.ref(`/configuration/${user.uid...