refactor(training): Update should just get the struct
This commit is contained in:
parent
04e5710b00
commit
2f6c24652e
1 changed files with 3 additions and 3 deletions
|
|
@ -4,7 +4,7 @@ type TrainingRepository interface {
|
|||
Create(training *Training) error
|
||||
FindByID(id TrainingID) (*Training, error)
|
||||
FindAll() ([]Training, error)
|
||||
Update(id TrainingID, training *Training) error
|
||||
Update(training *Training) error
|
||||
Delete(id TrainingID) error
|
||||
}
|
||||
|
||||
|
|
@ -68,8 +68,8 @@ func (r *InMemoryTrainingRepository) FindAll() ([]Training, error) {
|
|||
return trainings, nil
|
||||
}
|
||||
|
||||
func (r *InMemoryTrainingRepository) Update(id TrainingID, training *Training) error {
|
||||
r.trainings[id] = *training
|
||||
func (r *InMemoryTrainingRepository) Update(training *Training) error {
|
||||
r.trainings[training.ID] = *training
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in a new issue