mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-11 17:26:45 +02:00
1 file changed
+11
-4
@@ -79,12 +79,19 @@ export default function Settings() {
|
||||
});
|
||||
|
||||
const saveOpenrouterMutation = useMutation({
|
||||
mutationFn: () =>
|
||||
apiRequest('POST', '/api/openrouter/config', {
|
||||
apiKey: openrouterApiKey,
|
||||
mutationFn: () => {
|
||||
const payload: any = {
|
||||
model: openrouterModel,
|
||||
systemPrompt: openrouterSystemPrompt,
|
||||
}),
|
||||
};
|
||||
|
||||
// N'inclure apiKey que s'il n'est pas vide
|
||||
if (openrouterApiKey && openrouterApiKey.trim() !== "") {
|
||||
payload.apiKey = openrouterApiKey;
|
||||
}
|
||||
|
||||
return apiRequest('POST', '/api/openrouter/config', payload);
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['/api/openrouter/config'] });
|
||||
toast({
|
||||
|
||||
Reference in new issue
Block a user