This commit is contained in:
@@ -48,7 +48,10 @@ func (p *postRepository) GetAll(ctx context.Context) ([]storage.PostReq, error)
|
||||
|
||||
func (p *postRepository) GetByID(ctx context.Context, id int) (storage.PostReq, error) {
|
||||
var result storage.PostReq
|
||||
row := p.db.QueryRow("SELECT title, content, CREATED_AT FROM posts WHERE id = ? AND published = 1", id)
|
||||
row := p.db.QueryRow(
|
||||
"SELECT title, content, CREATED_AT FROM posts WHERE id = ? AND published = 1",
|
||||
id,
|
||||
)
|
||||
var title string
|
||||
var content string
|
||||
var createdAt string
|
||||
|
||||
Reference in New Issue
Block a user