From 10d696f4cafe200d1f0640dabf57512810ae1238 Mon Sep 17 00:00:00 2001 From: Oscar Date: Mon, 8 Jun 2026 15:01:54 +0300 Subject: [PATCH] =?UTF-8?q?refactor(composables):=20migrate=20stores=20?= =?UTF-8?q?=E2=86=92=20=20=20composables,=20align=20with=20updated=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace deleted Pinia stores with module-level singleton composables (useAuth, useChat, useFeed, useUi) — all return reactive({...}) so Refs auto-unwrap in both templates and script code - Align entire codebase with new swagger-generated api.ts types: · TagDto.value (was .name) — FeedCard, FeedFilters, ProfileEditor, ProfileSetupView, MyProfileView, ProfileDetailView, useUi · MediaItemDto[] / .path (was mediaUrls[], avatarUrl) — FeedCard, FeedView, MyProfileView, ProfileDetailView · ChatDto.status 'active'|'closed' (was isActive: boolean) — ChatRoomView, ChatsListView · MessageDto.profileId (was senderId) — ChatRoomView, ChatBubble · MeResponseDto → fetchMe now calls /me + /profiles/my in parallel · Token refresh: res.data.data.accessToken (nested wrapper) — router/index.ts aligned with client.ts interceptor - Fix FeedCard, ChatBubble imports pointing to deleted store files - Fix ProfileSetupView form type to avoid string|undefined on v-model - Fix history.back() → window.history.back() via goBack() helper - Fix chat.unreadCount possibly-undefined guard in ChatsListView - Fix MapPicker Leaflet icon cast (as unknown as Record) --- README.md | 28 +- package.json | 3 +- pnpm-lock.yaml | 22 -- src/App.vue | 6 +- src/api/api.ts | 355 +++++++++++++++++++--- src/components/chat/ChatBubble.vue | 2 +- src/components/common/AppToast.vue | 4 +- src/components/dates/DateProposalForm.vue | 8 +- src/components/dates/MapPicker.vue | 2 +- src/components/feed/FeedCard.vue | 12 +- src/components/feed/FeedCardStack.vue | 12 +- src/components/feed/FeedFilters.vue | 16 +- src/components/layout/AppShell.vue | 4 +- src/components/layout/BottomNav.vue | 2 - src/components/layout/SideNav.vue | 8 +- src/components/profile/MediaGallery.vue | 4 +- src/components/profile/ProfileEditor.vue | 20 +- src/components/reports/ReportModal.vue | 8 +- src/composables/useAuth.ts | 130 ++++++++ src/composables/useChat.ts | 117 +++++++ src/composables/useFeed.ts | 66 ++++ src/composables/useProfile.ts | 39 +++ src/composables/useUi.ts | 82 +++++ src/main.ts | 3 - src/router/index.ts | 10 +- src/stores/auth.store.ts | 125 -------- src/stores/chat.store.ts | 117 ------- src/stores/feed.store.ts | 71 ----- src/stores/profile.store.ts | 40 --- src/stores/ui.store.ts | 83 ----- src/views/admin/ReportsView.vue | 4 +- src/views/auth/LoginView.vue | 8 +- src/views/auth/RegisterView.vue | 8 +- src/views/chat/ChatRoomView.vue | 30 +- src/views/chat/ChatsListView.vue | 24 +- src/views/dates/DatesView.vue | 8 +- src/views/feed/FeedView.vue | 12 +- src/views/matches/MatchesView.vue | 12 +- src/views/onboarding/ProfileSetupView.vue | 26 +- src/views/profile/MyProfileView.vue | 24 +- src/views/profile/ProfileDetailView.vue | 31 +- 41 files changed, 913 insertions(+), 673 deletions(-) create mode 100644 src/composables/useAuth.ts create mode 100644 src/composables/useChat.ts create mode 100644 src/composables/useFeed.ts create mode 100644 src/composables/useProfile.ts create mode 100644 src/composables/useUi.ts delete mode 100644 src/stores/auth.store.ts delete mode 100644 src/stores/chat.store.ts delete mode 100644 src/stores/feed.store.ts delete mode 100644 src/stores/profile.store.ts delete mode 100644 src/stores/ui.store.ts diff --git a/README.md b/README.md index e6c35a7..fcd3d56 100644 --- a/README.md +++ b/README.md @@ -4,21 +4,21 @@ Vue 3 + Vite + Tauri v2. Работает как PWA в браузере и ка ## Стек -| Слой | Технология | -|---|---| -| UI framework | Vue 3 (Composition API, `