import { queryOptions } from '@tanstack/react-query';
import { getOrganizers } from './service';
import type { OrganizerFilters } from './types';

const organizerAllKey = ['organizers'] as const;

export const organizerKeys = {
  all: organizerAllKey,
  list: (filters: OrganizerFilters) => [...organizerAllKey, 'list', filters] as const
};

export const organizersQueryOptions = (filters: OrganizerFilters = {}) =>
  queryOptions({
    queryKey: organizerKeys.list(filters),
    queryFn: () => getOrganizers(filters)
  });
