feat: timeline and folder import
This commit is contained in:
@@ -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,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user