pin to homepage and liveblog ticker
This commit is contained in:
1 parent
5a457fa99f
commit
4ccb65ba88
11 files changed
+782
-157
No files matched your search
@@ -43,6 +43,22 @@ export function useRecentLiveBlogs() {
|
||||
});
|
||||
}
|
||||
|
||||
export function usePinnedLiveBlogs() {
|
||||
return useQuery({
|
||||
queryKey: ['pinnedLiveBlogs'],
|
||||
queryFn: () => api.fetchPinnedLiveBlogs(),
|
||||
refetchInterval: 30000, // Refetch every 30 seconds
|
||||
});
|
||||
}
|
||||
|
||||
export function useActiveLiveBlogs() {
|
||||
return useQuery({
|
||||
queryKey: ['activeLiveBlogs'],
|
||||
queryFn: () => api.fetchActiveLiveBlogs(),
|
||||
refetchInterval: 10000, // Refetch every 10 seconds for ticker
|
||||
});
|
||||
}
|
||||
|
||||
// Live Blog Mutations (Admin)
|
||||
export function useCreateLiveBlogUpdate() {
|
||||
const queryClient = useQueryClient();
|
||||
@@ -109,7 +125,7 @@ export function useUpdateLiveBlog() {
|
||||
return useMutation({
|
||||
mutationFn: ({ id, dto }: { id: string; dto: api.UpdateLiveBlogDto }) =>
|
||||
api.updateLiveBlog(id, dto),
|
||||
onSuccess: (data, variables) => {
|
||||
onSuccess: () => {
|
||||
// Force immediate refetch of all live blog queries
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ['liveBlog'],
|
||||
|
||||
Reference in new issue
Block a user