(queryClient: QueryClient)
| 1797 | }; |
| 1798 | |
| 1799 | export const updateChatProviderConfig = (queryClient: QueryClient) => ({ |
| 1800 | mutationFn: async ({ |
| 1801 | providerConfigId, |
| 1802 | req, |
| 1803 | }: UpdateChatProviderConfigMutationArgs) => { |
| 1804 | const apiKey = req.api_key; |
| 1805 | return API.experimental.updateAIProvider(providerConfigId, { |
| 1806 | display_name: req.display_name, |
| 1807 | base_url: req.base_url, |
| 1808 | enabled: req.enabled, |
| 1809 | api_keys: |
| 1810 | req.api_key === undefined |
| 1811 | ? undefined |
| 1812 | : apiKey |
| 1813 | ? [{ api_key: apiKey }] |
| 1814 | : [], |
| 1815 | }); |
| 1816 | }, |
| 1817 | onSuccess: async () => { |
| 1818 | await invalidateChatConfigurationQueries(queryClient); |
| 1819 | }, |
| 1820 | }); |
| 1821 | |
| 1822 | export const deleteChatProviderConfig = (queryClient: QueryClient) => ({ |
| 1823 | mutationFn: (providerConfigId: string) => |
no test coverage detected