import { Injectable } from '@angular/core'; import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Observable, throwError } from 'rxjs'; import { catchError, retry } from 'rxjs/operators'; export interface NameCheckResponse { status: string; } @Injectable({ providedIn: 'root' }) export class RegisterBusinessNameService { constructor(private http: HttpClient) { } checkName(name: string) { const nameRequest = { name, }; return this.http.post('http://localhost:10000/name-check/', nameRequest).toPromise(); } }