feat(quick-5): add CreatedAt/UpdatedAt to playlist Summary struct

- Add CreatedAt and UpdatedAt string fields to Summary struct
- Format as RFC3339 at all construction sites in playlist.go and favorites.go
- Update TypeScript bindings with new fields in models.ts
This commit is contained in:
2026-03-01 08:51:00 -05:00
parent ea3648f3f8
commit bdaff478e8
3 changed files with 51 additions and 13 deletions
+11 -2
View File
@@ -3,6 +3,7 @@ package playlist
import (
"errors"
"fmt"
"time"
"yellowjacket/backend/database/sql/sqlcgen"
"yellowjacket/backend/events"
@@ -82,7 +83,10 @@ func (s *Service) EnsureDefaultPlaylist() {
)
s.emitEvent(events.PlaylistCreated, Summary{
ID: created.ID, Name: created.Name,
ID: created.ID,
Name: created.Name,
CreatedAt: created.CreatedAt.Format(time.RFC3339),
UpdatedAt: created.UpdatedAt.Format(time.RFC3339),
})
}
@@ -138,7 +142,12 @@ func (s *Service) GetDefaultPlaylistInfo() (
)
}
return Summary{ID: pl.ID, Name: pl.Name}, nil
return Summary{
ID: pl.ID,
Name: pl.Name,
CreatedAt: pl.CreatedAt.Format(time.RFC3339),
UpdatedAt: pl.UpdatedAt.Format(time.RFC3339),
}, nil
}
// ToggleDefaultPlaylistTrack adds or removes a single track