refactoring: upgrade nextjs; api => server actions
This commit is contained in:
1 parent
447be7d021
commit
03cfacf91c
45 files changed
+1034
-923
No files matched your search
@@ -1,14 +1,13 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { ORDER } from '../api/torrents/parsers/pirate-bay';
|
||||
|
||||
import API from './api';
|
||||
import { torrents } from '@/lib/api';
|
||||
import { ORDER } from '@/lib/api/parsers/pirate-bay';
|
||||
|
||||
const useTorrents = ({ query, order }: { query: string; order: ORDER }) => {
|
||||
return useQuery({
|
||||
enabled: Boolean(query),
|
||||
queryKey: ['pirate-bay', query, order],
|
||||
queryFn: () => API.torrents.pirateBay({ query, order })
|
||||
queryFn: () => torrents({ query, order })
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user