fix: added modified_at to ListRepo
This commit is contained in:
@@ -7,9 +7,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type List struct {
|
type List struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"created_at"`
|
||||||
|
ModifiedAt time.Time `json:"modified_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ListRepository interface {
|
type ListRepository interface {
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ func (r *ListRepo) CreateList(ctx context.Context, name string, userIDs []string
|
|||||||
list := &domain.List{Name: name}
|
list := &domain.List{Name: name}
|
||||||
|
|
||||||
err = tx.QueryRowContext(ctx,
|
err = tx.QueryRowContext(ctx,
|
||||||
"INSERT INTO lists (name) VALUES ($1) RETURNING id, created_at",
|
"INSERT INTO lists (name) VALUES ($1) RETURNING id, created_at, modified_at",
|
||||||
name,
|
name,
|
||||||
).Scan(&list.ID, &list.CreatedAt)
|
).Scan(&list.ID, &list.CreatedAt, &list.ModifiedAt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to insert list: %w", err)
|
return nil, fmt.Errorf("failed to insert list: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user