feat: add useTriggers with RQ

This commit is contained in:
Rıdvan Akca
2024-03-05 11:48:04 +03:00
parent 6a58d1e3da
commit 3301b038fe
3 changed files with 34 additions and 4 deletions

View File

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