From 565acde3cda310e2abce664c83218bc09b94e9c3 Mon Sep 17 00:00:00 2001 From: yyasha Date: Sat, 27 Jan 2024 12:38:33 +0300 Subject: [PATCH] fix bug in GetRecipe --- .gitignore | 1 + internal/storage/postgresql/postgresql.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1120be9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +docker-compose.yml diff --git a/internal/storage/postgresql/postgresql.go b/internal/storage/postgresql/postgresql.go index 034ca52..703589e 100644 --- a/internal/storage/postgresql/postgresql.go +++ b/internal/storage/postgresql/postgresql.go @@ -178,7 +178,7 @@ func (s *Storage) GetRecipes(ctx context.Context, offset, limit int) ([]models.R func (s *Storage) GetRecipe(ctx context.Context, r_id uint) (models.Recipe, error) { const op = "storage.postgresql.GetRecipe" - var recipe models.Recipe + var recipe models.Recipe = models.Recipe{ID: r_id} err := s.db.QueryRow( ctx,