Files
serpbear/services/misc.tsx
towfiqi bb4a6844b5 feat: Adds the ability to view the changelog and displays the latest version number.
- Adds a new Footer component.
- Adds a new Changelog component that displays the changelog.
2024-03-02 20:48:22 +06:00

11 lines
340 B
TypeScript

import { useQuery } from 'react-query';
export async function fetchChangelog() {
const res = await fetch('https://api.github.com/repos/towfiqi/serpbear/releases', { method: 'GET' });
return res.json();
}
export function useFetchChangelog() {
return useQuery('changelog', () => fetchChangelog(), { cacheTime: 60 * 60 * 1000 });
}