Envoie le langage au serveur

pull/2/head
Hugo PRADIER 1 year ago
parent cfea56891d
commit 62a99938bb

@ -63,7 +63,7 @@ export class EditorComponent implements OnInit{
// Le code à exécuter est le contenu de l'éditeur
const codeToExecute = this.editorContent;
this.codeExecutionService.executeCode(codeToExecute).subscribe(
this.codeExecutionService.executeCode(codeToExecute, this.mode).subscribe(
(response) => {
console.log('Réponse du serveur:', response);
console.log('Code qui va être exécuté:', codeToExecute);

@ -10,7 +10,7 @@ export class CodeExecutionService {
constructor(private http: HttpClient) {}
executeCode(code: string): Observable<any> {
return this.http.post<any>(this.apiUrl, { code });
executeCode(code: string, language: string): Observable<any> {
return this.http.post<any>(this.apiUrl, { code, language });
}
}
Loading…
Cancel
Save