Überarbeitung des Stripe Prozesses
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { lastValueFrom, Observable } from 'rxjs';
|
||||
import urlcat from 'urlcat';
|
||||
@@ -20,12 +20,19 @@ export class UserService {
|
||||
async save(user: User): Promise<User> {
|
||||
return await lastValueFrom(this.http.post<User>(`${this.apiBaseUrl}/bizmatch/user`, user));
|
||||
}
|
||||
async saveGuaranteed(user: User): Promise<User> {
|
||||
return await lastValueFrom(this.http.post<User>(`${this.apiBaseUrl}/bizmatch/user/guaranteed`, user));
|
||||
}
|
||||
async getById(id: string): Promise<User> {
|
||||
return await lastValueFrom(this.http.get<User>(`${this.apiBaseUrl}/bizmatch/user/${id}`));
|
||||
}
|
||||
async getByMail(mail: string): Promise<User> {
|
||||
async getByMail(mail: string, hideLoading: boolean = true): Promise<User> {
|
||||
const url = urlcat(`${this.apiBaseUrl}/bizmatch/user`, { mail });
|
||||
return await lastValueFrom(this.http.get<User>(url));
|
||||
let headers = new HttpHeaders();
|
||||
if (hideLoading) {
|
||||
headers = headers.set('X-Hide-Loading', 'true');
|
||||
}
|
||||
return await lastValueFrom(this.http.get<User>(url, { headers }));
|
||||
}
|
||||
async search(criteria?: UserListingCriteria): Promise<ResponseUsersArray> {
|
||||
return await lastValueFrom(this.http.post<ResponseUsersArray>(`${this.apiBaseUrl}/bizmatch/user/search`, criteria));
|
||||
|
||||
Reference in New Issue
Block a user