recuperation des profils avec email verifié
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve",
|
"start": "bash replace-prod-env.sh src/environments/environment.development.ts $ENV_URL && ng serve",
|
||||||
"start:dev": "docker compose up -d && ng serve",
|
"start:dev": "docker compose up -d && ng serve",
|
||||||
"build": "ng build",
|
"build": "ng build",
|
||||||
"watch": "ng build --watch --configuration development",
|
"watch": "ng build --watch --configuration development",
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
"tsc:watch": "tsc --noEmit --watch",
|
"tsc:watch": "tsc --noEmit --watch",
|
||||||
"prettier": "prettier --write \"src/**/*.{ts,html,scss,css,md,json}\"",
|
"prettier": "prettier --write \"src/**/*.{ts,html,scss,css,md,json}\"",
|
||||||
"prettier:check": "prettier --check \"src/**/*.{ts,html,scss,css,md,json}\"",
|
"prettier:check": "prettier --check \"src/**/*.{ts,html,scss,css,md,json}\"",
|
||||||
"format": "npm run prettier && npm run lint:fix",
|
"format": "bash replace-prod-env.sh src/environments/environment.development.ts http://localhost:8090 && npm run prettier && npm run lint:fix",
|
||||||
"lint": "ng lint",
|
"lint": "ng lint",
|
||||||
"lint:fix": "ng lint --fix",
|
"lint:fix": "ng lint --fix",
|
||||||
"clean:imports": "ts-unused-exports tsconfig.json --excludePathsFromReport=\"src/main.ts;src/environments\" && npm run lint:fix",
|
"clean:imports": "ts-unused-exports tsconfig.json --excludePathsFromReport=\"src/main.ts;src/environments\" && npm run lint:fix",
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ import { Observable } from 'rxjs';
|
|||||||
import { User } from '@app/domain/users/user.model';
|
import { User } from '@app/domain/users/user.model';
|
||||||
import { RegisterDto } from '@app/domain/authentification/dto/register-dto';
|
import { RegisterDto } from '@app/domain/authentification/dto/register-dto';
|
||||||
|
|
||||||
export type AuthResponse = {
|
export interface AuthResponse {
|
||||||
isValid: boolean;
|
isValid: boolean;
|
||||||
token: string;
|
token: string;
|
||||||
record: User;
|
record: User;
|
||||||
};
|
}
|
||||||
export interface AuthRepository {
|
export interface AuthRepository {
|
||||||
login(loginDto: LoginDto): Observable<AuthResponse>;
|
login(loginDto: LoginDto): Observable<AuthResponse>;
|
||||||
register(registerDto: RegisterDto): Observable<User>;
|
register(registerDto: RegisterDto): Observable<User>;
|
||||||
|
|||||||
@@ -11,7 +11,13 @@ export class PbProfileRepository implements ProfileRepository {
|
|||||||
private pb = new PocketBase(environment.baseUrl);
|
private pb = new PocketBase(environment.baseUrl);
|
||||||
|
|
||||||
list(): Observable<Profile[]> {
|
list(): Observable<Profile[]> {
|
||||||
return from(this.pb.collection('profiles').getFullList<Profile>({ sort: 'profession' }));
|
return from(
|
||||||
|
this.pb.collection('profiles').getFullList<Profile>({
|
||||||
|
sort: 'profession',
|
||||||
|
expand: 'utilisateur',
|
||||||
|
filter: 'utilisateur.verified=true',
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getByUserId(userId: string): Observable<Profile> {
|
getByUserId(userId: string): Observable<Profile> {
|
||||||
|
|||||||
@@ -41,7 +41,11 @@ describe('PbProfileRepository', () => {
|
|||||||
|
|
||||||
repo.list().subscribe((result) => {
|
repo.list().subscribe((result) => {
|
||||||
expect(mockPocketBase.collection).toHaveBeenCalledWith('profiles');
|
expect(mockPocketBase.collection).toHaveBeenCalledWith('profiles');
|
||||||
expect(mockCollection.getFullList).toHaveBeenCalledWith({ sort: 'profession' });
|
expect(mockCollection.getFullList).toHaveBeenCalledWith({
|
||||||
|
sort: 'profession',
|
||||||
|
expand: 'utilisateur',
|
||||||
|
filter: 'utilisateur.verified=true',
|
||||||
|
});
|
||||||
expect(result).toEqual(mockProfiles);
|
expect(result).toEqual(mockProfiles);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user