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