Skip to content
Extraits de code Groupes Projets
Valider 425e8ac3 rédigé par zakariaeyahya's avatar zakariaeyahya
Parcourir les fichiers

removing log

parent 052cb5a7
Branches
Étiquettes
1 requête de fusion!94Resolve IA-439 "Feauture/"
Pipeline #21193 en échec avec les étapes
in 2 minutes et 23 secondes
"use client";
import { useEffect } from 'react';
import { useParams } from 'next/navigation';
......@@ -18,8 +16,8 @@ export default function AssistantSettingsPage() {
if (!assistantId) {
return (
<div style={{ padding: '20px', textAlign: 'center' }}>
<h2>ID d&apos;assistant manquant</h2>
<p>Veuillez vérifier l&apos;URL et réessayer.</p>
<h2>ID d'assistant manquant</h2>
<p>Veuillez vérifier l'URL et réessayer.</p>
</div>
);
}
......@@ -27,8 +25,8 @@ export default function AssistantSettingsPage() {
if (Number.isNaN(Number(assistantId))) {
return (
<div style={{ padding: '20px', textAlign: 'center' }}>
<h2>ID d&apos;assistant invalide</h2>
<p>L&apos;ID doit être un nombre. ID reçu&nbsp;: {assistantId}</p>
<h2>ID d'assistant invalide</h2>
<p>L'ID doit être un nombre. ID reçu&nbsp;: {assistantId}</p>
</div>
);
}
......
import { useEffect } from 'react';
import { useAssistantResponseConfigStore } from 'src/shared/api/stores/assistantResponseConfigStore';
export function useAssistantConfig(assistantId: string | number) {
......@@ -20,14 +19,11 @@ export function useAssistantConfig(assistantId: string | number) {
useEffect(() => {
if (assistantIdStr && assistantIdStr !== '0' && assistantIdStr !== '') {
console.log("🔍 Loading config for assistant:", assistantIdStr);
getResponseConfig(assistantIdStr);
} else {
console.error("❌ Invalid assistantId:", assistantIdStr);
}
}, [assistantIdStr, getResponseConfig]);
// Fonctions wrapper pour simplifier l'usage
// Wrapper functions to simplify usage
const handleAddPhrase = async (phrase: string) => {
if (phrase.trim()) {
await addMotivationalPhrase(assistantIdStr, phrase.trim());
......@@ -51,24 +47,24 @@ export function useAssistantConfig(assistantId: string | number) {
};
return {
// État
// State
config: responseConfig,
loading,
error,
// Actions simplifiées
// Simplified actions
addPhrase: handleAddPhrase,
removePhrase: handleRemovePhrase,
toggleVoice: handleToggleVoice,
toggleImage: handleToggleImage,
reset: handleReset,
clearError,
// Raccourcis vers les données
// Shortcuts to data
motivationalPhrases: responseConfig?.motivationalPhrases || [],
audioFormats: responseConfig?.audioFormats || [],
voiceTranscription: responseConfig?.voiceTranscription || false,
imageSupport: responseConfig?.imageSupport || false,
welcomeMessage: responseConfig?.welcomeMessage || ''
};
}
\ No newline at end of file
}
0% ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter