- albumsApi → albumApi로 수정 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
36 lines
794 B
JavaScript
36 lines
794 B
JavaScript
import { useQuery } from '@tanstack/react-query';
|
|
import { albumApi } from '@/api';
|
|
|
|
/**
|
|
* 앨범 목록 조회 훅
|
|
*/
|
|
export function useAlbums() {
|
|
return useQuery({
|
|
queryKey: ['albums'],
|
|
queryFn: albumApi.getAlbums,
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 앨범 상세 조회 훅
|
|
* @param {string} title - 앨범 타이틀 또는 폴더명
|
|
*/
|
|
export function useAlbumDetail(title) {
|
|
return useQuery({
|
|
queryKey: ['album', title],
|
|
queryFn: () => albumApi.getAlbumByTitle(title),
|
|
enabled: !!title,
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 앨범 갤러리 조회 훅
|
|
* @param {string} title - 앨범 타이틀 또는 폴더명
|
|
*/
|
|
export function useAlbumGallery(title) {
|
|
return useQuery({
|
|
queryKey: ['album-gallery', title],
|
|
queryFn: () => albumApi.getAlbumGallery(title),
|
|
enabled: !!title,
|
|
});
|
|
}
|