Changeset 99c1e45 for chapterx-frontend/src/store/authStore.ts
- Timestamp:
- 06/24/26 16:28:50 (11 days ago)
- Branches:
- main
- Children:
- a8f4a2d
- Parents:
- 0b502c2
- File:
-
- 1 edited
-
chapterx-frontend/src/store/authStore.ts (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
chapterx-frontend/src/store/authStore.ts
r0b502c2 r99c1e45 2 2 import { persist } from 'zustand/middleware' 3 3 import { User, UserRole } from '../types' 4 import { mockUsers } from '../data/mockData'5 4 import axios from 'axios' 6 5 … … 153 152 const res = await axios.get(`${API_BASE}/users`) 154 153 const data: any[] = res.data?.users ?? res.data ?? [] 154 const existing = get().allUsers 155 155 const users: User[] = data.map((u: any) => ({ 156 156 user_id: u.id, … … 163 163 follower_count: 0, 164 164 following_count: 0, 165 bio: existing.find(e => e.user_id === u.id)?.bio, 165 166 })) 166 167 set({ allUsers: users })
Note:
See TracChangeset
for help on using the changeset viewer.
