fix: TS errors + Docker Compose running locally
- Removed unused imports (PublicRoute, GripVertical, addFromRecipe, X, ShoppingGroup) - Fixed HouseholdCard unused var - Fixed ShoppingPage household query (missing queryFn) - Killed tmux sessions, app runs fully on Docker now - 3 containers: db (postgres:17), backend (node:22), frontend (nginx)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { BrowserRouter, Routes, Route } from 'react-router'
|
||||
import { AppShell } from './components/layout/AppShell'
|
||||
import { AuthProvider } from './context/AuthContext'
|
||||
import { PublicRoute } from './components/auth/AuthGuard'
|
||||
import { HomePage } from './pages/HomePage'
|
||||
import { RecipePage } from './pages/RecipePage'
|
||||
import { SearchPage } from './pages/SearchPage'
|
||||
|
||||
@@ -66,7 +66,7 @@ export function HouseholdCard() {
|
||||
|
||||
const regenMut = useMutation({
|
||||
mutationFn: () => regenerateInviteCode(household!.id),
|
||||
onSuccess: (res) => {
|
||||
onSuccess: () => {
|
||||
qc.invalidateQueries({ queryKey: ['household'] })
|
||||
showToast.success('Neuer Code generiert')
|
||||
},
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { createContext, useContext, useState, useEffect, type ReactNode } from 'react'
|
||||
import {
|
||||
type User,
|
||||
getMe,
|
||||
refreshToken,
|
||||
logout as apiLogout
|
||||
} from '../api/auth'
|
||||
import { setAuthToken, getAuthToken } from '../api/token'
|
||||
import { setAuthToken } from '../api/token'
|
||||
|
||||
interface AuthContextType {
|
||||
user: User | null
|
||||
|
||||
@@ -2,12 +2,11 @@ import { useState, useEffect, useRef } from 'react'
|
||||
import { useParams, useNavigate } from 'react-router'
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import toast from 'react-hot-toast'
|
||||
import { ArrowLeft, Plus, Trash2, Camera, X, GripVertical, Link, Loader2 } from 'lucide-react'
|
||||
import { ArrowLeft, Plus, Trash2, Camera, X, Link, Loader2 } from 'lucide-react'
|
||||
import { fetchRecipe, createRecipe, updateRecipe, deleteRecipe, uploadRecipeImage, fetchOgPreview } from '../api/recipes'
|
||||
import { fetchCategories } from '../api/categories'
|
||||
import { Confetti } from '../components/ui/Confetti'
|
||||
import type { RecipeFormData } from '../api/recipes'
|
||||
import type { Ingredient, Step } from '../api/types'
|
||||
|
||||
interface IngredientRow {
|
||||
key: string
|
||||
|
||||
@@ -6,7 +6,7 @@ import toast from 'react-hot-toast'
|
||||
import { ArrowLeft, Heart, Clock, Users, ChefHat, ShoppingCart, Pencil, Minus, Plus, Send, Trash2 } from 'lucide-react'
|
||||
import { Dices } from 'lucide-react'
|
||||
import { fetchRecipe, toggleFavorite, fetchRandomRecipe } from '../api/recipes'
|
||||
import { addFromRecipe, addCustomItem } from '../api/shopping'
|
||||
import { addCustomItem } from '../api/shopping'
|
||||
import { IngredientPickerModal } from '../components/recipe/IngredientPickerModal'
|
||||
import { createNote, deleteNote } from '../api/notes'
|
||||
import { Badge } from '../components/ui/Badge'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, useRef } from 'react'
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import { Trash2, Plus, X } from 'lucide-react'
|
||||
import { Trash2, Plus } from 'lucide-react'
|
||||
import {
|
||||
fetchShopping,
|
||||
addCustomItem,
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
deleteChecked,
|
||||
deleteAll,
|
||||
} from '../api/shopping'
|
||||
import type { ShoppingGroup, ShoppingItem } from '../api/shopping'
|
||||
import type { ShoppingItem } from '../api/shopping'
|
||||
import { useAuth } from '../context/AuthContext'
|
||||
import { EmptyState } from '../components/ui/EmptyState'
|
||||
|
||||
@@ -23,10 +23,19 @@ export function ShoppingPage() {
|
||||
// Check if user has a household
|
||||
const { data: householdData } = useQuery({
|
||||
queryKey: ['household'],
|
||||
queryFn: async () => {
|
||||
const { getMyHousehold } = await import('../api/households')
|
||||
try {
|
||||
const res = await getMyHousehold()
|
||||
return res.data
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
},
|
||||
enabled: isAuthenticated,
|
||||
retry: false,
|
||||
})
|
||||
const hasHousehold = !!householdData?.data
|
||||
const hasHousehold = !!householdData
|
||||
|
||||
const activeScope = hasHousehold ? scope : undefined
|
||||
|
||||
|
||||
Reference in New Issue
Block a user