feat: initialisation complète du projet CESIZen
- Backend Laravel 11 (API REST, JWT auth, PostgreSQL) - Frontend Next.js 14 (React, TypeScript, Tailwind CSS) - Docker Compose (PostgreSQL, backend, frontend) - Modules : auth, profil, tracker émotions, informations, admin
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import api from '@/lib/api';
|
||||
import type { Feed } from '@/types';
|
||||
|
||||
export function useFeeds() {
|
||||
return useQuery<Feed[]>({
|
||||
queryKey: ['feeds'],
|
||||
queryFn: async () => {
|
||||
const response = await api.get('/feeds');
|
||||
return response.data;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function useFeed(slug: string) {
|
||||
return useQuery<Feed>({
|
||||
queryKey: ['feeds', slug],
|
||||
queryFn: async () => {
|
||||
const response = await api.get(`/feeds/${slug}`);
|
||||
return response.data;
|
||||
},
|
||||
enabled: !!slug,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user