From c94f711da73ef8d4582d8576768cfdb8685182b9 Mon Sep 17 00:00:00 2001 From: Yanislav Igonin Date: Tue, 5 Oct 2021 22:48:49 +0300 Subject: [PATCH] todo --- repositories/posts_repository.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/repositories/posts_repository.go b/repositories/posts_repository.go index fa3d4d9..3d775a9 100644 --- a/repositories/posts_repository.go +++ b/repositories/posts_repository.go @@ -187,5 +187,22 @@ func (r *PostsRepository) CreateInTx(tx pgx.Tx, p Post) (int, error) { return 0, err } + // TODO: fix dat shit + // updating parent post `updated_at` + // if !p.IsParent { + // sql = ` + // UPDATE posts + // SET updated_at = now() + // WHERE id = $1 + // ` + // rows, err := tx.Query(context.TODO(), sql, p.ParentID) + // if err != nil { + // return 0, err + // } + // if rows.Err() != nil { + // return 0, err + // } + // } + return createdPost.ID, nil }