mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
New schema for pixels and links.
This commit is contained in:
parent
c60e8b3d23
commit
88639dfe83
67 changed files with 993 additions and 208 deletions
15
src/components/hooks/queries/useLinkQuery.ts
Normal file
15
src/components/hooks/queries/useLinkQuery.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { useApi } from '../useApi';
|
||||
import { useModified } from '../useModified';
|
||||
|
||||
export function useLinkQuery(linkId: string) {
|
||||
const { get, useQuery } = useApi();
|
||||
const { modified } = useModified(`link:${linkId}`);
|
||||
|
||||
return useQuery({
|
||||
queryKey: ['link', { linkId, modified }],
|
||||
queryFn: () => {
|
||||
return get(`/link/${linkId}`);
|
||||
},
|
||||
enabled: !!linkId,
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue