feat: add useActions with RQ

This commit is contained in:
Rıdvan Akca
2024-03-05 11:56:59 +03:00
parent 3301b038fe
commit c4b2ea125c
3 changed files with 25 additions and 3 deletions

View File

@@ -0,0 +1,18 @@
import { useQuery } from '@tanstack/react-query';
import api from 'helpers/api';
export default function useActions(appKey) {
const query = useQuery({
queryKey: ['actions', appKey],
queryFn: async ({ payload, signal }) => {
const { data } = await api.get(`/v1/apps/${appKey}/actions`, {
signal,
});
return data;
},
});
return query;
}