stylist / frontend / src / api / useFetchReccommendedSalons.ts
useFetchReccommendedSalons.ts
Raw
import { useQuery } from 'react-query';

import { api } from '.';
//types
import { SalonReccommended } from '@/types/salon';

const fetchReccommendedSalons = async () =>
  await api.get<never, SalonReccommended[]>('/salons/recommended');

export const useFetchReccommendedSalons = () => {
  return useQuery(['salons/recommended'], fetchReccommendedSalons);
};