- Add support for multiple share URLs per website with server-generated slugs - Create shares API endpoint for listing and creating website shares - Add SharesTable, ShareEditButton, ShareDeleteButton components - Move share management to website settings, remove header share button - Remove shareId from website update API (now uses separate share table) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
21 lines
582 B
TypeScript
21 lines
582 B
TypeScript
import type { ReactQueryOptions } from '@/lib/types';
|
|
import { useApi } from '../useApi';
|
|
import { useModified } from '../useModified';
|
|
import { usePagedQuery } from '../usePagedQuery';
|
|
|
|
export function useWebsiteSharesQuery(
|
|
{ websiteId }: { websiteId: string },
|
|
options?: ReactQueryOptions,
|
|
) {
|
|
const { modified } = useModified('shares');
|
|
const { get } = useApi();
|
|
|
|
return usePagedQuery({
|
|
queryKey: ['websiteShares', { websiteId, modified }],
|
|
queryFn: pageParams => {
|
|
return get(`/websites/${websiteId}/shares`, pageParams);
|
|
},
|
|
...options,
|
|
});
|
|
}
|