Add registrar selection functionality (#2054)

This commit is contained in:
Pavlo Tkach 2023-06-14 16:51:54 -04:00 committed by GitHub
parent 952a92a5db
commit 86b62ebe76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 350 additions and 65 deletions

View file

@ -41,35 +41,11 @@ export class BackendService {
}
getContacts(registrarId: string): Observable<Contact[]> {
const mockData = [
{
name: 'Name Lastname',
emailAddress: 'test@google.com',
registrarId: 'zoomco',
types: ['ADMIN'],
visibleInWhoisAsAdmin: false,
visibleInWhoisAsTech: false,
visibleInDomainWhoisAsAbuse: false,
},
{
name: 'Testname testlastname',
emailAddress: 'testasd@google.com',
registrarId: 'zoomco',
visibleInWhoisAsAdmin: false,
visibleInWhoisAsTech: false,
visibleInDomainWhoisAsAbuse: false,
types: ['BILLING'],
},
];
return this.http
.get<Contact[]>(
`/console-api/settings/contacts?registrarId=${registrarId}`
)
.pipe(
catchError((err) =>
this.errorCatcher<Contact[]>(err, <Contact[]>mockData)
)
);
.pipe(catchError((err) => this.errorCatcher<Contact[]>(err)));
}
postContacts(
@ -81,4 +57,10 @@ export class BackendService {
{ contacts }
);
}
getRegistrars(): Observable<string[]> {
return this.http
.get<string[]>('/console-api/registrars')
.pipe(catchError((err) => this.errorCatcher<string[]>(err)));
}
}