ui overhaul
This commit is contained in:
@@ -53,7 +53,7 @@ func List(ctx context.Context, q DBTX, id int64) (domain.List, error) {
|
||||
}
|
||||
|
||||
func Cards(ctx context.Context, q DBTX, listID int64) ([]domain.Card, error) {
|
||||
rows, err := q.QueryContext(ctx, `SELECT id, list_id, title, description, position, done, created_at, updated_at
|
||||
rows, err := q.QueryContext(ctx, `SELECT id, list_id, title, description, position, created_at, updated_at
|
||||
FROM cards WHERE list_id = ? ORDER BY position, id`, listID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -71,7 +71,7 @@ func Cards(ctx context.Context, q DBTX, listID int64) ([]domain.Card, error) {
|
||||
}
|
||||
|
||||
func Card(ctx context.Context, q DBTX, id int64) (domain.Card, error) {
|
||||
row := q.QueryRowContext(ctx, `SELECT id, list_id, title, description, position, done, created_at, updated_at
|
||||
row := q.QueryRowContext(ctx, `SELECT id, list_id, title, description, position, created_at, updated_at
|
||||
FROM cards WHERE id = ?`, id)
|
||||
card, err := scanCard(row)
|
||||
if err == sql.ErrNoRows {
|
||||
@@ -84,10 +84,7 @@ type scanner interface{ Scan(...any) error }
|
||||
|
||||
func scanCard(row scanner) (domain.Card, error) {
|
||||
var card domain.Card
|
||||
var done int
|
||||
err := row.Scan(&card.ID, &card.ListID, &card.Title, &card.Description, &card.Position, &done, &card.CreatedAt, &card.UpdatedAt)
|
||||
card.Done = done != 0
|
||||
return card, err
|
||||
return card, row.Scan(&card.ID, &card.ListID, &card.Title, &card.Description, &card.Position, &card.CreatedAt, &card.UpdatedAt)
|
||||
}
|
||||
|
||||
func Snapshot(ctx context.Context, q DBTX) (domain.Snapshot, error) {
|
||||
|
||||
Reference in New Issue
Block a user