feat: timeline and folder import

This commit is contained in:
2026-04-07 00:42:22 +02:00
parent 6d1b227fb9
commit 78e12e8309
20 changed files with 1036 additions and 75 deletions

View File

@@ -8,14 +8,16 @@ import axios from 'axios'
interface Photo {
id: string
path: string
filepath: string
filename: string
width: number
height: number
date_taken: string | null
width: number | null
height: number | null
taken_at: string | null
rating: number
flag: string | null
hash: string
is_picked: boolean
is_rejected: boolean
file_hash: string
media_type: string
}
export function Timeline() {
@@ -61,13 +63,13 @@ export function Timeline() {
const { data: photos = [], isLoading } = useQuery({
queryKey: ['photos'],
queryFn: async () => {
const response = await axios.get<Photo[]>('http://localhost:8001/api/v1/photos', {
const response = await axios.get<{photos: Photo[], total: number}>('http://localhost:8001/api/v1/photos', {
params: {
limit: 1000,
offset: 0,
},
})
return response.data
return response.data.photos || []
},
staleTime: 30000,
})