| 124 | }); |
| 125 | |
| 126 | export const squadIntelQueryOptions = ({ |
| 127 | user, |
| 128 | sourceId, |
| 129 | enabled = true, |
| 130 | }: { |
| 131 | user?: Pick<LoggedUser, 'id'>; |
| 132 | sourceId?: string; |
| 133 | enabled?: boolean; |
| 134 | }) => ({ |
| 135 | queryKey: generateQueryKey(RequestKey.SquadIntel, user, sourceId), |
| 136 | queryFn: async (): Promise<SquadIntel | null> => { |
| 137 | const res = await gqlClient.request<{ squadIntel: SquadIntel | null }>( |
| 138 | SQUAD_INTEL_QUERY, |
| 139 | { sourceId }, |
| 140 | ); |
| 141 | |
| 142 | return res.squadIntel; |
| 143 | }, |
| 144 | enabled: enabled && !!user?.id && !!sourceId, |
| 145 | staleTime: StaleTime.Default, |
| 146 | retry: false, |
| 147 | }); |
| 148 | |
| 149 | export const updateSquadIntelSettings = async ({ |
| 150 | sourceId, |