Oviya commited on
Commit
4e121c9
·
1 Parent(s): 1202633

add vocabularybuilder

Browse files
src/app/vocabulary-builder/vocabulary-builder.service.ts CHANGED
@@ -6,7 +6,10 @@ import { Observable } from 'rxjs';
6
  providedIn: 'root'
7
  })
8
  export class VocabularyBuilderService {
9
- private baseUrl: string = 'http://127.0.0.1:5002'; // Update the URL if needed
 
 
 
10
  constructor(private http: HttpClient) { }
11
 
12
  // Fetch vocabulary word and related options
@@ -15,18 +18,6 @@ export class VocabularyBuilderService {
15
  }
16
 
17
 
18
- // ✅ Fix: Add this missing method
19
- //getFeedback(): Observable<any> {
20
- // return this.http.get<any>(`${this.baseUrl}/get-feedback`); // Ensure your backend has this endpoint
21
- //}
22
-
23
- //getSentenceFeedback(): Observable<any> {
24
- // return this.http.get<any>(`${this.baseUrl}/get-sentence-feedback`); // Ensure this API exists in backend
25
- //}
26
-
27
-
28
-
29
-
30
  // Validate the user's selected words
31
  validateSelection(word: string, selectedWords: string[], allOptions: string[]): Observable<any> {
32
  // Construct the request body
 
6
  providedIn: 'root'
7
  })
8
  export class VocabularyBuilderService {
9
+
10
+ private baseUrl = location.hostname.endsWith('hf.space')
11
+ ? 'https://pykara-py-learn-backend.hf.space/media'
12
+ : 'http://localhost:5000/media';
13
  constructor(private http: HttpClient) { }
14
 
15
  // Fetch vocabulary word and related options
 
18
  }
19
 
20
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  // Validate the user's selected words
22
  validateSelection(word: string, selectedWords: string[], allOptions: string[]): Observable<any> {
23
  // Construct the request body