Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
FazCodeFR committed Feb 2, 2024
1 parent ea19096 commit 5dfc7ca
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/app/services/app.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable, map, share, take } from 'rxjs';
import { Chat } from '../interfaces/interfaces';

Expand Down Expand Up @@ -32,11 +32,16 @@ export class AppService {
}

getAllCats(): Observable<Chat[]> {
return this.http.get(this.api + '/chats').pipe(
map((res: any) => res),
share(),
take(1)
);
return this.http
.get(this.api + '/chats', {
headers: new HttpHeaders({ 'Access-Control-Allow-Origin': '*' }),
})
.pipe()
.pipe(
map((res: any) => res),
share(),
take(1)
);
}

getByIdCat(id: number): Observable<Chat> {
Expand Down

0 comments on commit 5dfc7ca

Please sign in to comment.