saveTrainingByIndex(index, training) {
    this.trainings = [
      ...this.trainings.slice(0, index),
      training,
      ...this.trainings.slice(index + 1)
    ];

    return Promise.resolve('Save training success');
  }
// object to update by training from params.
object to update by training from params.
object to update by training from params .
saveTrainingByIndex(index, training) {
    this.trainings = [
      ...this.trainings.slice(0, index),
      training,
      ...this.trainings.slice(index + 1)
    ];
    return Promise.resolve('Save training success');
  }
saveTrainingByIndex ( index , training ) { this . trainings = [ ... this . trainings . slice ( 0 , index ) , training , ... this . trainings . slice ( index + 1 ) ] ; return Promise . resolve ( 'Save training success' ) ; }
object to update by training from params.
object to update by training from params .