Changeset 0b502c2 for chapterx-frontend/src/store/storyStore.ts
- Timestamp:
- 06/23/26 17:20:47 (12 days ago)
- Branches:
- main
- Children:
- 99c1e45
- Parents:
- b373fea
- File:
-
- 1 edited
-
chapterx-frontend/src/store/storyStore.ts (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
chapterx-frontend/src/store/storyStore.ts
rb373fea r0b502c2 49 49 try { 50 50 const token = JSON.parse(localStorage.getItem('chapterx-auth') || '{}')?.state?.token 51 return token ? { Authorization: `Bearer ${token}` } : {} 51 if (!token || token === 'mock-token') return {} 52 return { Authorization: `Bearer ${token}` } 52 53 } catch { 53 54 return {} … … 145 146 created_at: s.createdAt, 146 147 updated_at: s.updatedAt, 147 total_likes: 0,148 total_comments: 0,149 total_chapters: 0,150 total_views: 0,148 total_likes: s.likes?.length ?? 0, 149 total_comments: s.comments?.length ?? 0, 150 total_chapters: s.chapters?.length ?? 0, 151 total_views: s.chapters?.reduce((sum: number, c: any) => sum + (c.viewCount ?? 0), 0) ?? 0, 151 152 genres: (s.hasGenres ?? []).map((hg: any) => hg.genre?.name ?? hg.name).filter(Boolean), 152 153 }))
Note:
See TracChangeset
for help on using the changeset viewer.
