File size: 275 Bytes
41a71fd
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
import { PostType } from '../model/types/post';
import { $api } from '@/shared/api/axiosInstance';

type FetchPostsResponse = PostType[];

export const fetchPosts = async () => {
    const { data } = await $api.get<FetchPostsResponse>(`/posts?limit=5`);

    return data;
};