refactor: repository pattern: rename Save() to Create()
This commit is contained in:
parent
ab4226561b
commit
cb9cc47245
8 changed files with 8 additions and 8 deletions
|
|
@ -14,7 +14,7 @@ func NewTrainingRepository(db *sql.DB) *TrainingRepository {
|
|||
return &TrainingRepository{db: db}
|
||||
}
|
||||
|
||||
func (r *TrainingRepository) Save(t *training.Training) error {
|
||||
func (r *TrainingRepository) Create(t *training.Training) error {
|
||||
_, err := r.db.Exec("INSERT INTO training (id, name, days, description, price) VALUES ($1, $2, $3)", t.ID, t.Name, t.Days, t.Description, t.Price)
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue