fixings
This commit is contained in:
parent
bad50a81cc
commit
d0b82dde31
|
@ -20,8 +20,6 @@ const (
|
|||
|
||||
//TODO
|
||||
// cache
|
||||
// app
|
||||
// graceful sd
|
||||
// tests
|
||||
|
||||
func main() {
|
||||
|
@ -33,9 +31,9 @@ func main() {
|
|||
log.Debug("debug messages are enabled")
|
||||
log.Debug("Application config", slog.Any("config", fmt.Sprintf("%+v", *cfg)))
|
||||
|
||||
// init app (storage, cache, media storage)
|
||||
// init app
|
||||
application := app.New(log, cfg)
|
||||
// start app
|
||||
// start server
|
||||
go application.HTTPSrv.MustRun()
|
||||
|
||||
// graceful shutdown
|
||||
|
|
|
@ -184,7 +184,7 @@ func (s *Storage) GetRecipe(ctx context.Context, r_id uint) (models.Recipe, erro
|
|||
ctx,
|
||||
"select title, description, image, cooking_time, servings, cal from recipe where id = $1",
|
||||
r_id,
|
||||
).Scan(&recipe)
|
||||
).Scan(&recipe.Title, &recipe.Description, &recipe.Image, &recipe.CookingTime, &recipe.ServingsNum, &recipe.Calories)
|
||||
|
||||
if err != nil {
|
||||
if errors.Is(err, pgx.ErrNoRows) {
|
||||
|
@ -353,10 +353,10 @@ func (s *Storage) GetRecipesByCategory(ctx context.Context, offset, limit int, c
|
|||
return nil, fmt.Errorf("%s: %w", op, err)
|
||||
}
|
||||
|
||||
err = s.AddRecipeInformation(ctx, &r)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%s: %w", op, err)
|
||||
}
|
||||
// err = s.AddRecipeInformation(ctx, &r)
|
||||
// if err != nil {
|
||||
// return nil, fmt.Errorf("%s: %w", op, err)
|
||||
// }
|
||||
|
||||
recipes = append(recipes, r)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue