Files
movie-advisor/app/(site)/search/api.ts
T
2023-08-05 12:28:04 +03:00

24 lines
491 B
TypeScript

import client from '@/network';
const API = {
search: {
byTitle({ query, page }: { query: string; page: number }): Promise<MovieDBResponse> {
return client.get('/search', {
params: {
query,
page
}
});
},
byDescription({ description }: { description: string }): Promise<Array<Movie>> {
return client.get('/search/description', {
params: {
description
}
});
}
}
};
export default API;