mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-23 15:08:13 +02:00
1 file changed
+11
-4
@@ -79,12 +79,19 @@ export default function Settings() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const saveOpenrouterMutation = useMutation({
|
const saveOpenrouterMutation = useMutation({
|
||||||
mutationFn: () =>
|
mutationFn: () => {
|
||||||
apiRequest('POST', '/api/openrouter/config', {
|
const payload: any = {
|
||||||
apiKey: openrouterApiKey,
|
|
||||||
model: openrouterModel,
|
model: openrouterModel,
|
||||||
systemPrompt: openrouterSystemPrompt,
|
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: () => {
|
onSuccess: () => {
|
||||||
queryClient.invalidateQueries({ queryKey: ['/api/openrouter/config'] });
|
queryClient.invalidateQueries({ queryKey: ['/api/openrouter/config'] });
|
||||||
toast({
|
toast({
|
||||||
|
|||||||
Reference in new issue
Block a user