I want my notes sorted
This commit is contained in:
@@ -134,7 +134,7 @@ func (s *SQLiteStore) GetNoteByID(ctx context.Context, id int) (models.Note, err
|
|||||||
|
|
||||||
func (s *SQLiteStore) GetAllNotes(ctx context.Context) ([]models.Note, error) {
|
func (s *SQLiteStore) GetAllNotes(ctx context.Context) ([]models.Note, error) {
|
||||||
rows, err := s.read.QueryContext(ctx, `
|
rows, err := s.read.QueryContext(ctx, `
|
||||||
SELECT id, content, last_update FROM notes ORDER BY last_update DESC;
|
SELECT id, content, last_update FROM notes ORDER BY id ASC;
|
||||||
`)
|
`)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to query all notes: %w", err)
|
return nil, fmt.Errorf("failed to query all notes: %w", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user