Untitled
unknown
tsx
2 years ago
597 B
14
Indexable
import api from '@/services/apiServcie';
import { BookType } from '@/types/routes/global/book.type';
import { AxiosResponse } from 'axios';
type AxiosResponseType = BookType[];
export const APIfetchSimilarBooks = async (args: {
categoryName: string;
}): Promise<AxiosResponseType> => {
const {
data: { data },
}: AxiosResponse<{ data: AxiosResponseType }> = await api.post(
'/similarBooksListAPI',
{
pageNumber: 0,
category: args.categoryName,
},
{
headers: { 'Content-Type': 'application/json' },
},
);
return data;
};
Editor is loading...