ciyidogan commited on
Commit
a7ba805
·
verified ·
1 Parent(s): 3617e72

Update flare-ui/src/app/services/api.service.ts

Browse files
flare-ui/src/app/services/api.service.ts CHANGED
@@ -300,14 +300,22 @@ export class ApiService {
300
 
301
  // ===================== Chat =====================
302
  startChat() {
303
- return this.http.post<any>(`${this.apiUrl}/startchat`, {});
 
 
 
 
304
  }
305
 
306
  chat(sessionId: string, text: string) {
307
- return this.http.post<any>(`${this.apiUrl}/chat`, {
308
  session_id: sessionId,
309
  text
310
- });
 
 
 
 
311
  }
312
 
313
  // ===================== Error Handler =====================
 
300
 
301
  // ===================== Chat =====================
302
  startChat() {
303
+ return this.http.post(`${this.apiUrl}/start_chat`, {}, {
304
+ headers: this.getAuthHeaders()
305
+ }).pipe(
306
+ catchError(this.handleError)
307
+ );
308
  }
309
 
310
  chat(sessionId: string, text: string) {
311
+ return this.http.post(`${this.apiUrl}/chat`, {
312
  session_id: sessionId,
313
  text
314
+ }, {
315
+ headers: this.getAuthHeaders()
316
+ }).pipe(
317
+ catchError(this.handleError)
318
+ );
319
  }
320
 
321
  // ===================== Error Handler =====================