Skip to content

Refactor Weekly module to use React Query hooks and unified API layer#10

Open
cto-new[bot] wants to merge 2 commits into
mainfrom
refactor-follow-docs
Open

Refactor Weekly module to use React Query hooks and unified API layer#10
cto-new[bot] wants to merge 2 commits into
mainfrom
refactor-follow-docs

Conversation

@cto-new

@cto-new cto-new Bot commented Nov 15, 2025

Copy link
Copy Markdown
Contributor

Summary
Consolidates Weekly module data fetching behind React Query hooks and unifies API interactions with new hooks.

Details

  • Replace inline fetch calls in Weekly list, editor, preview, and share pages with new hooks (useWeeklyList/useWeeklyDetail and related hooks).
  • Introduce useUpdateWeekly and useDeleteWeekly that rely on a unified API mutation hook (useApiMutation) and apply optimistic updates.
  • Extend WeeklyIssue type with fields start_date, end_date, total_items, total_word_count, reading_time, published_at, contents to align with API shape.
  • Refactor WeeklyEditor, WeeklyPreview, and WeeklyShare to depend on useWeeklyDetail and associated hooks, reducing inline fetch logic.
  • Centralize error handling and loading state management via React Query and global error boundaries.
  • Introduce operation log integration for dashboard (useOperationLogs) and prepare for cohesive analytics display.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants