ui overhaul
Some checks failed
Build and deploy Havenllo / Verify Go and frontend (push) Failing after 29s
Build and deploy Havenllo / Build and push image (push) Has been skipped
Build and deploy Havenllo / Apply and restart Havenllo (push) Has been skipped

This commit is contained in:
Hermes
2026-07-14 11:09:54 -03:00
parent 240f73b229
commit afd23ca751
19 changed files with 603 additions and 382 deletions

View File

@@ -135,8 +135,8 @@ func (s *Service) CreateCard(ctx context.Context, listID int64, title, descripti
return domain.Card{}, err
}
now := timestamp()
result, err := tx.ExecContext(ctx, `INSERT INTO cards (list_id, title, description, position, done, created_at, updated_at)
VALUES (?, ?, ?, ?, 0, ?, ?)`, listID, title, description, pos, now, now)
result, err := tx.ExecContext(ctx, `INSERT INTO cards (list_id, title, description, position, created_at, updated_at)
VALUES (?, ?, ?, ?, ?, ?)`, listID, title, description, pos, now, now)
if err != nil {
return domain.Card{}, err
}
@@ -154,7 +154,6 @@ func (s *Service) CreateCard(ctx context.Context, listID int64, title, descripti
type CardPatch struct {
Title *string
Description *string
Done *bool
ListID *int64
Position *float64
}
@@ -189,9 +188,6 @@ func (s *Service) UpdateCard(ctx context.Context, id int64, patch CardPatch) (do
if patch.Description != nil {
card.Description = *patch.Description
}
if patch.Done != nil {
card.Done = *patch.Done
}
if patch.ListID != nil {
if _, err := store.List(ctx, tx, *patch.ListID); err != nil {
return domain.Card{}, err
@@ -207,12 +203,8 @@ func (s *Service) UpdateCard(ctx context.Context, id int64, patch CardPatch) (do
}
card.Position = pos + positionStep
}
done := 0
if card.Done {
done = 1
}
if _, err := tx.ExecContext(ctx, `UPDATE cards SET list_id = ?, title = ?, description = ?, position = ?, done = ?, updated_at = ? WHERE id = ?`,
card.ListID, card.Title, card.Description, card.Position, done, timestamp(), id); err != nil {
if _, err := tx.ExecContext(ctx, `UPDATE cards SET list_id = ?, title = ?, description = ?, position = ?, updated_at = ? WHERE id = ?`,
card.ListID, card.Title, card.Description, card.Position, timestamp(), id); err != nil {
return domain.Card{}, err
}
if err := normalizeCards(ctx, tx, sourceListID); err != nil {