fix: remove UpdatedAt field from watchlist upsert
also add missing currentEpisode query param in HandleAPIEpisodes
This commit is contained in:
@@ -324,6 +324,7 @@ func (h *Handler) HandleAPIEpisodes(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
w.Header().Set("Cache-Control", "public, max-age=3600")
|
w.Header().Set("Cache-Control", "public, max-age=3600")
|
||||||
|
|
||||||
|
currentEpisode := r.URL.Query().Get("current")
|
||||||
episodes, err := h.getEpisodes(r.Context(), id)
|
episodes, err := h.getEpisodes(r.Context(), id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("episodes error: %v", err)
|
log.Printf("episodes error: %v", err)
|
||||||
|
|||||||
@@ -103,7 +103,6 @@ func (s *Service) CompleteAnime(ctx context.Context, userID string, animeID int6
|
|||||||
Status: "completed",
|
Status: "completed",
|
||||||
CurrentEpisode: sql.NullInt64{Int64: 0, Valid: false},
|
CurrentEpisode: sql.NullInt64{Int64: 0, Valid: false},
|
||||||
CurrentTimeSeconds: 0,
|
CurrentTimeSeconds: 0,
|
||||||
UpdatedAt: sql.NullTime{Valid: true},
|
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return fmt.Errorf("failed to mark watchlist as completed: %w", err)
|
return fmt.Errorf("failed to mark watchlist as completed: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ func (s *Service) AddEntry(ctx context.Context, userID string, req AddRequest) e
|
|||||||
Status: req.Status,
|
Status: req.Status,
|
||||||
CurrentEpisode: sql.NullInt64{Int64: 0, Valid: false},
|
CurrentEpisode: sql.NullInt64{Int64: 0, Valid: false},
|
||||||
CurrentTimeSeconds: 0,
|
CurrentTimeSeconds: 0,
|
||||||
UpdatedAt: sql.NullTime{Valid: false},
|
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to update watchlist: %w", err)
|
return fmt.Errorf("failed to update watchlist: %w", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user