fromis_9/frontend-temp/src/hooks/useAlbumData.js
caadiq 6c25d32259 fix(frontend): useAlbumData albumApi import 수정
- albumsApi → albumApi로 수정

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 18:05:14 +09:00

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,
});
}