From 5bcabb273619b65f9a0f9754a7031562108d9bf8 Mon Sep 17 00:00:00 2001 From: Arrelin Date: Thu, 29 Jan 2026 12:38:21 +0000 Subject: [PATCH] revert 30b1c97043f3af895a2797e9941251af2d49ad9b revert Merge pull request 'try to do better' (#18) from refactor/frontend-code-quality into master Reviewed-on: http://192.168.31.100:3847/Arrelin/family_budget/pulls/18 --- frontend/src/components/ErrorBoundary.tsx | 7 +++---- frontend/src/components/ShoppingListModal.tsx | 8 ++++++++ .../src/components/family/AddCategorySection.tsx | 2 +- frontend/src/components/family/CategoryCard.tsx | 4 ++-- frontend/src/components/family/CategoryList.tsx | 2 +- frontend/src/components/family/FamilySummary.tsx | 2 +- frontend/src/components/family/InviteModal.tsx | 2 +- .../src/components/profile/FamilySection.tsx | 2 +- .../src/components/profile/MembersSection.tsx | 3 ++- .../src/components/profile/SettingsSection.tsx | 2 +- .../src/components/profile/ThemeSelector.tsx | 2 +- frontend/src/components/profile/UserInfo.tsx | 2 +- .../src/components/shopping/ShoppingItemCard.tsx | 4 +++- .../components/shopping/ShoppingItemInput.tsx | 3 +-- .../src/components/shopping/ShoppingItemList.tsx | 2 +- frontend/src/components/ui/Badge.tsx | 2 +- frontend/src/components/ui/Button.tsx | 2 +- frontend/src/components/ui/Card.tsx | 2 +- frontend/src/components/ui/Input.tsx | 3 +-- frontend/src/components/ui/Modal.tsx | 3 +-- frontend/src/constants/index.ts | 2 +- frontend/src/hooks/useCategories.ts | 5 ++--- frontend/src/hooks/useExpenses.ts | 2 +- frontend/src/hooks/useFamilyMembers.ts | 2 +- frontend/src/hooks/useInviteLink.ts | 2 +- frontend/src/hooks/useShoppingList.ts | 2 +- frontend/src/pages/Profile.tsx | 16 ++++++++++++++-- frontend/src/services/categoryService.ts | 2 +- frontend/src/services/expenseService.ts | 2 +- frontend/src/services/familyService.ts | 2 +- frontend/src/services/inviteService.ts | 2 +- frontend/src/services/shoppingService.ts | 2 +- frontend/src/store/useStore.ts | 2 +- frontend/src/utils/errorHandler.ts | 2 +- 34 files changed, 61 insertions(+), 43 deletions(-) diff --git a/frontend/src/components/ErrorBoundary.tsx b/frontend/src/components/ErrorBoundary.tsx index 2e9dd69..d2dbf28 100644 --- a/frontend/src/components/ErrorBoundary.tsx +++ b/frontend/src/components/ErrorBoundary.tsx @@ -1,5 +1,4 @@ -import React, { Component } from 'react'; -import type { ReactNode } from 'react'; +import React, { Component, ReactNode } from 'react'; import { AlertTriangle } from 'lucide-react'; import { Button } from './ui'; @@ -23,7 +22,7 @@ export class ErrorBoundary extends Component { }; } - static getDerivedStateFromError(_error: Error): Partial { + static getDerivedStateFromError(error: Error): Partial { return { hasError: true }; } @@ -58,7 +57,7 @@ export class ErrorBoundary extends Component {

We're sorry, but something unexpected happened. Please try refreshing the page or going back to the home page.

- {import.meta.env.DEV && this.state.error && ( + {process.env.NODE_ENV === 'development' && this.state.error && (

{this.state.error.toString()} diff --git a/frontend/src/components/ShoppingListModal.tsx b/frontend/src/components/ShoppingListModal.tsx index 78c32fe..533baf0 100644 --- a/frontend/src/components/ShoppingListModal.tsx +++ b/frontend/src/components/ShoppingListModal.tsx @@ -1,3 +1,4 @@ +import { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { ShoppingCart, CheckCheck, Trash2 } from 'lucide-react'; import { useShoppingList, useConfirm } from '../hooks'; @@ -15,6 +16,7 @@ export default function ShoppingListModal({ familyId, onClose }: ShoppingListMod const { t } = useTranslation(); const { items, loading, createItem, deleteItem, togglePurchased, markAllAsPurchased, clearAll } = useShoppingList(familyId); const { confirmState, confirm, cancel } = useConfirm(); + const [pendingAction, setPendingAction] = useState<{ type: 'delete' | 'markAll' | 'clearAll'; itemId?: number } | null>(null); const stats = shoppingService.getStats(items); @@ -23,18 +25,24 @@ export default function ShoppingListModal({ familyId, onClose }: ShoppingListMod }; const handleDelete = async (itemId: number) => { + setPendingAction({ type: 'delete', itemId }); await confirm(t('shopping.deleteConfirm'), t('shopping.deleteMessage')); await deleteItem(itemId); + setPendingAction(null); }; const handleMarkAll = async () => { + setPendingAction({ type: 'markAll' }); await confirm(t('shopping.markAllConfirm'), t('shopping.markAllMessage')); await markAllAsPurchased(); + setPendingAction(null); }; const handleClearAll = async () => { + setPendingAction({ type: 'clearAll' }); await confirm(t('shopping.clearAllConfirm'), t('shopping.clearAllMessage')); await clearAll(); + setPendingAction(null); }; const handleUpdate = async (itemId: number, name: string) => { diff --git a/frontend/src/components/family/AddCategorySection.tsx b/frontend/src/components/family/AddCategorySection.tsx index 950f244..fc90a1e 100644 --- a/frontend/src/components/family/AddCategorySection.tsx +++ b/frontend/src/components/family/AddCategorySection.tsx @@ -2,7 +2,7 @@ import { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Plus, X } from 'lucide-react'; import { Button, Input } from '../ui'; -import type { CreateCategoryRequest } from '../../types'; +import { CreateCategoryRequest } from '../../types'; interface AddCategorySectionProps { showForm: boolean; diff --git a/frontend/src/components/family/CategoryCard.tsx b/frontend/src/components/family/CategoryCard.tsx index 51e1836..a6f66d8 100644 --- a/frontend/src/components/family/CategoryCard.tsx +++ b/frontend/src/components/family/CategoryCard.tsx @@ -1,11 +1,11 @@ import { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Tag, TrendingDown, Plus, Trash2, RotateCcw, History, X, DollarSign, MessageSquare, Calendar } from 'lucide-react'; -import type { CategoryWithRemaining } from '../../services'; +import { CategoryWithRemaining } from '../../services'; import { categoryService, expenseService } from '../../services'; import { useExpenses } from '../../hooks'; import { format } from '../../utils/format'; -import { Button, Input } from '../ui'; +import { Button, Input, Badge } from '../ui'; interface CategoryCardProps { category: CategoryWithRemaining; diff --git a/frontend/src/components/family/CategoryList.tsx b/frontend/src/components/family/CategoryList.tsx index 007be48..255e1b8 100644 --- a/frontend/src/components/family/CategoryList.tsx +++ b/frontend/src/components/family/CategoryList.tsx @@ -1,4 +1,4 @@ -import type { CategoryWithRemaining } from '../../services'; +import { CategoryWithRemaining } from '../../services'; import { CategoryCard } from './CategoryCard'; interface CategoryListProps { diff --git a/frontend/src/components/family/FamilySummary.tsx b/frontend/src/components/family/FamilySummary.tsx index f5ac183..2a77632 100644 --- a/frontend/src/components/family/FamilySummary.tsx +++ b/frontend/src/components/family/FamilySummary.tsx @@ -1,6 +1,6 @@ import { Wallet, ShoppingCart } from 'lucide-react'; import { useTranslation } from 'react-i18next'; -import type { CategoryWithRemaining } from '../../services'; +import { CategoryWithRemaining } from '../../services'; import { format } from '../../utils/format'; interface FamilySummaryProps { diff --git a/frontend/src/components/family/InviteModal.tsx b/frontend/src/components/family/InviteModal.tsx index eba6419..ff49c3b 100644 --- a/frontend/src/components/family/InviteModal.tsx +++ b/frontend/src/components/family/InviteModal.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next'; import { Copy, Check, Loader2 } from 'lucide-react'; import { Modal, Button } from '../ui'; import { useInviteLink } from '../../hooks'; -import type { InviteLinkResponse } from '../../types'; +import { InviteLinkResponse } from '../../types'; interface InviteModalProps { onClose: () => void; diff --git a/frontend/src/components/profile/FamilySection.tsx b/frontend/src/components/profile/FamilySection.tsx index 0712809..97c2d63 100644 --- a/frontend/src/components/profile/FamilySection.tsx +++ b/frontend/src/components/profile/FamilySection.tsx @@ -1,7 +1,7 @@ import { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Users, Edit3, Save, X, AlertTriangle, Loader2 } from 'lucide-react'; -import type { Family } from '../../types'; +import { Family } from '../../types'; import { Card, Button, Input } from '../ui'; import { familyService } from '../../services'; import { showToast } from '../../utils/toast'; diff --git a/frontend/src/components/profile/MembersSection.tsx b/frontend/src/components/profile/MembersSection.tsx index 35c7e1a..2bdf847 100644 --- a/frontend/src/components/profile/MembersSection.tsx +++ b/frontend/src/components/profile/MembersSection.tsx @@ -1,5 +1,6 @@ import { useTranslation } from 'react-i18next'; -import type { FamilyMember, User } from '../../types'; +import { Loader2 } from 'lucide-react'; +import { FamilyMember, User } from '../../types'; import { Badge, LoadingSpinner } from '../ui'; interface MembersSectionProps { diff --git a/frontend/src/components/profile/SettingsSection.tsx b/frontend/src/components/profile/SettingsSection.tsx index 8294b68..f66a7d6 100644 --- a/frontend/src/components/profile/SettingsSection.tsx +++ b/frontend/src/components/profile/SettingsSection.tsx @@ -1,6 +1,6 @@ import { Settings, Palette, Languages } from 'lucide-react'; import { useTranslation } from 'react-i18next'; -import type { Theme } from '../../types'; +import { Theme } from '../../types'; import { Card } from '../ui'; import { ThemeSelector } from './ThemeSelector'; import { LanguageSelector } from './LanguageSelector'; diff --git a/frontend/src/components/profile/ThemeSelector.tsx b/frontend/src/components/profile/ThemeSelector.tsx index fdf5cf1..3c433cb 100644 --- a/frontend/src/components/profile/ThemeSelector.tsx +++ b/frontend/src/components/profile/ThemeSelector.tsx @@ -1,6 +1,6 @@ import { Check } from 'lucide-react'; import { useTranslation } from 'react-i18next'; -import type { Theme } from '../../types'; +import { Theme } from '../../types'; import { THEMES } from '../../constants'; interface ThemeSelectorProps { diff --git a/frontend/src/components/profile/UserInfo.tsx b/frontend/src/components/profile/UserInfo.tsx index 17724a2..f843d72 100644 --- a/frontend/src/components/profile/UserInfo.tsx +++ b/frontend/src/components/profile/UserInfo.tsx @@ -1,6 +1,6 @@ import { User as UserIcon, LogOut } from 'lucide-react'; import { useTranslation } from 'react-i18next'; -import type { User } from '../../types'; +import { User } from '../../types'; import { Button, Card } from '../ui'; interface UserInfoProps { diff --git a/frontend/src/components/shopping/ShoppingItemCard.tsx b/frontend/src/components/shopping/ShoppingItemCard.tsx index 1767135..228ef4f 100644 --- a/frontend/src/components/shopping/ShoppingItemCard.tsx +++ b/frontend/src/components/shopping/ShoppingItemCard.tsx @@ -1,6 +1,7 @@ import { useState } from 'react'; +import { useTranslation } from 'react-i18next'; import { Trash2, Check, Pencil, X } from 'lucide-react'; -import type { ShoppingItem } from '../../types'; +import { ShoppingItem } from '../../types'; import { Button, Input } from '../ui'; interface ShoppingItemCardProps { @@ -11,6 +12,7 @@ interface ShoppingItemCardProps { } export function ShoppingItemCard({ item, onToggle, onDelete, onUpdate }: ShoppingItemCardProps) { + const { t } = useTranslation(); const [isEditing, setIsEditing] = useState(false); const [editName, setEditName] = useState(item.name); diff --git a/frontend/src/components/shopping/ShoppingItemInput.tsx b/frontend/src/components/shopping/ShoppingItemInput.tsx index ec2ea24..012883c 100644 --- a/frontend/src/components/shopping/ShoppingItemInput.tsx +++ b/frontend/src/components/shopping/ShoppingItemInput.tsx @@ -1,5 +1,4 @@ -import { useState } from 'react'; -import type { KeyboardEvent } from 'react'; +import { useState, KeyboardEvent } from 'react'; import { useTranslation } from 'react-i18next'; import { Plus } from 'lucide-react'; import { Button, Input } from '../ui'; diff --git a/frontend/src/components/shopping/ShoppingItemList.tsx b/frontend/src/components/shopping/ShoppingItemList.tsx index 3268398..a55e922 100644 --- a/frontend/src/components/shopping/ShoppingItemList.tsx +++ b/frontend/src/components/shopping/ShoppingItemList.tsx @@ -1,5 +1,5 @@ import { useTranslation } from 'react-i18next'; -import type { ShoppingItem } from '../../types'; +import { ShoppingItem } from '../../types'; import { ShoppingItemCard } from './ShoppingItemCard'; import { shoppingService } from '../../services'; diff --git a/frontend/src/components/ui/Badge.tsx b/frontend/src/components/ui/Badge.tsx index 6b9e14d..2484ce5 100644 --- a/frontend/src/components/ui/Badge.tsx +++ b/frontend/src/components/ui/Badge.tsx @@ -1,4 +1,4 @@ -import type { ReactNode } from 'react'; +import { ReactNode } from 'react'; interface BadgeProps { children: ReactNode; diff --git a/frontend/src/components/ui/Button.tsx b/frontend/src/components/ui/Button.tsx index 24e85fa..0161b52 100644 --- a/frontend/src/components/ui/Button.tsx +++ b/frontend/src/components/ui/Button.tsx @@ -1,4 +1,4 @@ -import type { ButtonHTMLAttributes, ReactNode } from 'react'; +import { ButtonHTMLAttributes, ReactNode } from 'react'; interface ButtonProps extends ButtonHTMLAttributes { variant?: 'primary' | 'success' | 'danger' | 'secondary' | 'ghost'; diff --git a/frontend/src/components/ui/Card.tsx b/frontend/src/components/ui/Card.tsx index 2ddf30c..e64bb4c 100644 --- a/frontend/src/components/ui/Card.tsx +++ b/frontend/src/components/ui/Card.tsx @@ -1,4 +1,4 @@ -import type { ReactNode } from 'react'; +import { ReactNode } from 'react'; interface CardProps { children: ReactNode; diff --git a/frontend/src/components/ui/Input.tsx b/frontend/src/components/ui/Input.tsx index 09ea5f5..66a48db 100644 --- a/frontend/src/components/ui/Input.tsx +++ b/frontend/src/components/ui/Input.tsx @@ -1,5 +1,4 @@ -import { forwardRef } from 'react'; -import type { InputHTMLAttributes } from 'react'; +import { InputHTMLAttributes, forwardRef } from 'react'; interface InputProps extends InputHTMLAttributes { label?: string; diff --git a/frontend/src/components/ui/Modal.tsx b/frontend/src/components/ui/Modal.tsx index b367f9f..973c8c6 100644 --- a/frontend/src/components/ui/Modal.tsx +++ b/frontend/src/components/ui/Modal.tsx @@ -1,5 +1,4 @@ -import { useEffect } from 'react'; -import type { ReactNode } from 'react'; +import { ReactNode, useEffect } from 'react'; interface ModalProps { isOpen: boolean; diff --git a/frontend/src/constants/index.ts b/frontend/src/constants/index.ts index d823c7a..30eee60 100644 --- a/frontend/src/constants/index.ts +++ b/frontend/src/constants/index.ts @@ -1,4 +1,4 @@ -import type { Theme } from '../types'; +import { Theme } from '../types'; export const THEMES: { id: Theme; gradient: string; name: string }[] = [ { id: 'light', gradient: 'bg-gradient-to-r from-gray-100 to-gray-200', name: 'Light' }, diff --git a/frontend/src/hooks/useCategories.ts b/frontend/src/hooks/useCategories.ts index 23f7e8b..ded3243 100644 --- a/frontend/src/hooks/useCategories.ts +++ b/frontend/src/hooks/useCategories.ts @@ -1,7 +1,6 @@ import { useState, useEffect, useCallback } from 'react'; -import { categoryService } from '../services'; -import type { CategoryWithRemaining } from '../services'; -import type { CreateCategoryRequest } from '../types'; +import { categoryService, CategoryWithRemaining } from '../services'; +import { CreateCategoryRequest } from '../types'; import { showToast } from '../utils/toast'; import { showErrorToast } from '../utils/errorHandler'; diff --git a/frontend/src/hooks/useExpenses.ts b/frontend/src/hooks/useExpenses.ts index e982e74..0978490 100644 --- a/frontend/src/hooks/useExpenses.ts +++ b/frontend/src/hooks/useExpenses.ts @@ -1,6 +1,6 @@ import { useState, useEffect, useCallback } from 'react'; import { expenseService } from '../services'; -import type { Expense, CreateExpenseRequest } from '../types'; +import { Expense, CreateExpenseRequest } from '../types'; import { showToast } from '../utils/toast'; import { showErrorToast } from '../utils/errorHandler'; diff --git a/frontend/src/hooks/useFamilyMembers.ts b/frontend/src/hooks/useFamilyMembers.ts index 094d8ff..2c7a83f 100644 --- a/frontend/src/hooks/useFamilyMembers.ts +++ b/frontend/src/hooks/useFamilyMembers.ts @@ -1,6 +1,6 @@ import { useState, useEffect, useCallback } from 'react'; import { familyService } from '../services'; -import type { FamilyMember } from '../types'; +import { FamilyMember } from '../types'; import { showErrorToast } from '../utils/errorHandler'; export function useFamilyMembers(familyId: number | null) { diff --git a/frontend/src/hooks/useInviteLink.ts b/frontend/src/hooks/useInviteLink.ts index 137e342..570d4e8 100644 --- a/frontend/src/hooks/useInviteLink.ts +++ b/frontend/src/hooks/useInviteLink.ts @@ -1,6 +1,6 @@ import { useState, useEffect, useCallback } from 'react'; import { inviteService } from '../services'; -import type { InviteLinkResponse, CreateInviteLinkRequest } from '../types'; +import { InviteLinkResponse, CreateInviteLinkRequest } from '../types'; import { showToast } from '../utils/toast'; import { showErrorToast } from '../utils/errorHandler'; diff --git a/frontend/src/hooks/useShoppingList.ts b/frontend/src/hooks/useShoppingList.ts index 72805fd..96e95e5 100644 --- a/frontend/src/hooks/useShoppingList.ts +++ b/frontend/src/hooks/useShoppingList.ts @@ -1,6 +1,6 @@ import { useState, useEffect, useCallback } from 'react'; import { shoppingService } from '../services'; -import type { ShoppingItem, CreateShoppingItemRequest } from '../types'; +import { ShoppingItem, CreateShoppingItemRequest } from '../types'; import { showToast } from '../utils/toast'; import { showErrorToast } from '../utils/errorHandler'; diff --git a/frontend/src/pages/Profile.tsx b/frontend/src/pages/Profile.tsx index bd7efe2..f84919b 100644 --- a/frontend/src/pages/Profile.tsx +++ b/frontend/src/pages/Profile.tsx @@ -5,8 +5,9 @@ import { User as UserIcon } from 'lucide-react'; import { familyApi, authApi } from '../api/client'; import { useStore } from '../store/useStore'; import { useFamilyMembers, useConfirm } from '../hooks'; -import type { Theme } from '../types'; +import { Theme } from '../types'; import { ProfileHeader } from '../components/profile/ProfileHeader'; +import { UserInfo } from '../components/profile/UserInfo'; import { FamilySection } from '../components/profile/FamilySection'; import { MembersSection } from '../components/profile/MembersSection'; import { SettingsSection } from '../components/profile/SettingsSection'; @@ -18,7 +19,7 @@ export default function Profile() { const { t, i18n } = useTranslation(); const navigate = useNavigate(); const { user, selectedFamily, setSelectedFamily, setUser, preferences, setPreferences } = useStore(); - const { members, loading: membersLoading } = useFamilyMembers(user?.family_id || null); + const { members, loading: membersLoading, loadMembers } = useFamilyMembers(user?.family_id || null); const { confirmState, confirm, cancel } = useConfirm(); const [leavingFamily, setLeavingFamily] = useState(false); @@ -60,6 +61,17 @@ export default function Profile() { } }; + const handleLogout = async () => { + try { + await authApi.logout(); + setUser(null); + setSelectedFamily(null); + navigate('/login'); + } catch (error) { + showErrorToast(error); + } + }; + const handleThemeChange = (theme: Theme) => { setPreferences({ ...preferences, theme }); showToast.success(t('profile.themeChanged')); diff --git a/frontend/src/services/categoryService.ts b/frontend/src/services/categoryService.ts index c861029..86aaf25 100644 --- a/frontend/src/services/categoryService.ts +++ b/frontend/src/services/categoryService.ts @@ -1,5 +1,5 @@ import { categoryApi, expenseApi } from '../api/client'; -import type { Category, CreateCategoryRequest } from '../types'; +import { Category, CreateCategoryRequest, RemainingLimit } from '../types'; import { handleApiError } from '../utils/errorHandler'; export interface CategoryWithRemaining extends Category { diff --git a/frontend/src/services/expenseService.ts b/frontend/src/services/expenseService.ts index 6d7f58e..355ad14 100644 --- a/frontend/src/services/expenseService.ts +++ b/frontend/src/services/expenseService.ts @@ -1,5 +1,5 @@ import { expenseApi } from '../api/client'; -import type { Expense, CreateExpenseRequest } from '../types'; +import { Expense, CreateExpenseRequest } from '../types'; import { handleApiError } from '../utils/errorHandler'; export const expenseService = { diff --git a/frontend/src/services/familyService.ts b/frontend/src/services/familyService.ts index cd0417f..31e24ad 100644 --- a/frontend/src/services/familyService.ts +++ b/frontend/src/services/familyService.ts @@ -1,5 +1,5 @@ import { familyApi } from '../api/client'; -import type { Family, CreateFamilyRequest, CreateMyFamilyRequest, CreateMyFamilyResponse, VerifyFamilyPasswordRequest, FamilyMember } from '../types'; +import { Family, CreateFamilyRequest, CreateMyFamilyRequest, CreateMyFamilyResponse, VerifyFamilyPasswordRequest, FamilyMember } from '../types'; import { handleApiError } from '../utils/errorHandler'; export const familyService = { diff --git a/frontend/src/services/inviteService.ts b/frontend/src/services/inviteService.ts index 2872af6..54def6a 100644 --- a/frontend/src/services/inviteService.ts +++ b/frontend/src/services/inviteService.ts @@ -1,5 +1,5 @@ import { inviteLinkApi } from '../api/client'; -import type { CreateInviteLinkRequest, InviteLinkResponse, ValidateInviteResponse, JoinFamilyResponse } from '../types'; +import { CreateInviteLinkRequest, InviteLinkResponse, ValidateInviteResponse, JoinFamilyResponse } from '../types'; import { handleApiError } from '../utils/errorHandler'; export const inviteService = { diff --git a/frontend/src/services/shoppingService.ts b/frontend/src/services/shoppingService.ts index f800122..e7e8790 100644 --- a/frontend/src/services/shoppingService.ts +++ b/frontend/src/services/shoppingService.ts @@ -1,5 +1,5 @@ import { shoppingItemApi } from '../api/client'; -import type { ShoppingItem, CreateShoppingItemRequest, UpdateShoppingItemRequest, MarkAsPurchasedRequest } from '../types'; +import { ShoppingItem, CreateShoppingItemRequest, UpdateShoppingItemRequest, MarkAsPurchasedRequest } from '../types'; import { handleApiError } from '../utils/errorHandler'; export const shoppingService = { diff --git a/frontend/src/store/useStore.ts b/frontend/src/store/useStore.ts index b69eaaa..b2f34ce 100644 --- a/frontend/src/store/useStore.ts +++ b/frontend/src/store/useStore.ts @@ -124,7 +124,7 @@ export const useStore = create((set, get) => ({ }, clearCache: () => { - set(() => ({ + set((state) => ({ cache: { categories: new Map(), members: new Map(), diff --git a/frontend/src/utils/errorHandler.ts b/frontend/src/utils/errorHandler.ts index 43adde3..ec2acd1 100644 --- a/frontend/src/utils/errorHandler.ts +++ b/frontend/src/utils/errorHandler.ts @@ -1,5 +1,5 @@ import { AxiosError } from 'axios'; -import { AppError } from '../types/errors'; +import { ApiError, AppError } from '../types/errors'; import { showToast } from './toast'; export function handleApiError(error: unknown): never { -- 2.49.1