Skip to content

Commit

Permalink
Fix Frontend API call
Browse files Browse the repository at this point in the history
  • Loading branch information
dedsecrattle committed Nov 9, 2024
1 parent a50e606 commit 5854f52
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions frontend/src/components/HintBox/HintBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const HintBox: React.FC<HintBoxProps> = ({ onClose, questionId, code, language }
setError("");
try {
// Fetch Hint
console.log('Fetching hint for questionId:', questionId);
console.log("Fetching hint for questionId:", questionId);
const hintResponse = await axios.get(`${AI_HINT_SERVICE_URL}/api/hint/${questionId}`, {
headers: {
"Content-Type": "application/json",
Expand All @@ -46,14 +46,14 @@ const HintBox: React.FC<HintBoxProps> = ({ onClose, questionId, code, language }
});
setModelAnswer(modelAnswerResponse.data.ai_answer);
// setModelAnswer("Model answer is not available for this question.");
console.log('User code:', code);
console.log('User Language:', language);
console.log("User code:", code);
console.log("User Language:", language);
// Fetch Code Complexity Analysis
const analysisResponse = await axios.post(
`${AI_HINT_SERVICE_URL}/api/code-analysis/`,
{
userCode: String(code),
userLanguage: String(language),
code: code,
language: language,
},
{
headers: {
Expand Down

0 comments on commit 5854f52

Please sign in to comment.