From 2ee047a801aff408b23edc0c3b5590d6cd945d2a Mon Sep 17 00:00:00 2001 From: Kichiyaki Date: Sun, 28 Feb 2021 17:59:53 +0100 Subject: [PATCH] [WIP]: rename question.Repository.FindByIDAndUpdate -> question.Repository.UpdateOneByID --- internal/question/repository.go | 2 +- internal/question/repository/pg_repository.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/question/repository.go b/internal/question/repository.go index f415461..da8e7b9 100644 --- a/internal/question/repository.go +++ b/internal/question/repository.go @@ -21,7 +21,7 @@ type GenerateTestConfig struct { type Repository interface { Store(ctx context.Context, input *models.QuestionInput) (*models.Question, error) - FindByIDAndUpdate(ctx context.Context, id int, input *models.QuestionInput) (*models.Question, error) + UpdateOneByID(ctx context.Context, id int, input *models.QuestionInput) (*models.Question, error) Delete(ctx context.Context, f *models.QuestionFilter) ([]*models.Question, error) Fetch(ctx context.Context, cfg *FetchConfig) ([]*models.Question, int, error) GenerateTest(ctx context.Context, cfg *GenerateTestConfig) ([]*models.Question, error) diff --git a/internal/question/repository/pg_repository.go b/internal/question/repository/pg_repository.go index 194b651..2b3960f 100644 --- a/internal/question/repository/pg_repository.go +++ b/internal/question/repository/pg_repository.go @@ -53,7 +53,7 @@ func (repo *pgRepository) Store(ctx context.Context, input *models.QuestionInput return item, nil } -func (repo *pgRepository) FindByIDAndUpdate(ctx context.Context, id int, input *models.QuestionInput) (*models.Question, error) { +func (repo *pgRepository) UpdateOneByID(ctx context.Context, id int, input *models.QuestionInput) (*models.Question, error) { item := &models.Question{} baseQuery := repo. Model(item).