fix: added modified_at to ListRepo

This commit is contained in:
Robin Dittmar
2026-07-20 21:06:21 +02:00
parent c623e02b6c
commit 5f4e95b3f7
2 changed files with 6 additions and 5 deletions
+1
View File
@@ -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 {
+2 -2
View File
@@ -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)
}