fix: pass generic type to api.get<T>() calls in admin pages
All checks were successful
Deploy Admin Frontend / build-and-deploy (push) Successful in 9s
All checks were successful
Deploy Admin Frontend / build-and-deploy (push) Successful in 9s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
cf1ea873e0
commit
d3665e9a02
@ -11,7 +11,7 @@ export default function CacheAdmin() {
|
|||||||
|
|
||||||
const { data: stats, isLoading } = useQuery({
|
const { data: stats, isLoading } = useQuery({
|
||||||
queryKey: ['admin', 'cache-stats'],
|
queryKey: ['admin', 'cache-stats'],
|
||||||
queryFn: (): Promise<CacheStats> => api.get('/admin-api/cache/stats'),
|
queryFn: (): Promise<CacheStats> => api.get<CacheStats>('/admin-api/cache/stats'),
|
||||||
refetchInterval: 10_000,
|
refetchInterval: 10_000,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -20,13 +20,13 @@ export default function NotificationAdmin() {
|
|||||||
const { data: templates, isLoading } = useQuery({
|
const { data: templates, isLoading } = useQuery({
|
||||||
queryKey: ['admin', 'notification-templates'],
|
queryKey: ['admin', 'notification-templates'],
|
||||||
queryFn: (): Promise<NotificationTemplate[]> =>
|
queryFn: (): Promise<NotificationTemplate[]> =>
|
||||||
api.get('/admin-api/notifications/templates').then((d: NotificationTemplate[]) => d ?? []),
|
api.get<NotificationTemplate[]>('/admin-api/notifications/templates').then(d => d ?? []),
|
||||||
})
|
})
|
||||||
|
|
||||||
const { data: sendLogs } = useQuery({
|
const { data: sendLogs } = useQuery({
|
||||||
queryKey: ['admin', 'notification-logs'],
|
queryKey: ['admin', 'notification-logs'],
|
||||||
queryFn: (): Promise<NotificationLog[]> =>
|
queryFn: (): Promise<NotificationLog[]> =>
|
||||||
api.get('/admin-api/notifications/send-log?limit=50').then((d: NotificationLog[]) => d ?? []),
|
api.get<NotificationLog[]>('/admin-api/notifications/send-log?limit=50').then(d => d ?? []),
|
||||||
})
|
})
|
||||||
|
|
||||||
const saveMutation = useMutation({
|
const saveMutation = useMutation({
|
||||||
|
|||||||
@ -21,7 +21,7 @@ export default function ReviewAdmin() {
|
|||||||
const params = new URLSearchParams()
|
const params = new URLSearchParams()
|
||||||
if (search) params.set('search', search)
|
if (search) params.set('search', search)
|
||||||
if (statusFilter) params.set('status', statusFilter)
|
if (statusFilter) params.set('status', statusFilter)
|
||||||
return api.get(`/admin-api/reviews?${params.toString()}`)
|
return api.get<PaginatedResult<ReviewCardItem>>(`/admin-api/reviews?${params.toString()}`)
|
||||||
},
|
},
|
||||||
refetchInterval: 30_000,
|
refetchInterval: 30_000,
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user