Import des sources angular à partir de 'headup_app'

This commit is contained in:
Rampeur
2025-08-11 23:26:29 +02:00
parent 7dcb426ef5
commit 0a6cbc0c00
335 changed files with 64362 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { ApiService } from 'src/app/core/services';
import { Profile } from 'src/app/core/models';
import { map } from 'rxjs/operators';
@Injectable({ providedIn: 'root' })
export class ProfilesService {
constructor(
private apiService: ApiService
) { }
get(username: string): Observable<Profile> {
return this.apiService.get('/profiles/' + username)
.pipe(map((data: { profile: Profile }) => data.profile));
}
follow(username: string): Observable<Profile> {
return this.apiService.post('/profiles/' + username + '/follow');
}
unfollow(username: string): Observable<Profile> {
return this.apiService.delete('/profiles/' + username + '/follow');
}
}