feat: client address feature (#99)

* client address feature
This commit is contained in:
Anwesh Nayak
2018-07-06 05:38:37 +05:30
committed by GitHub
parent 772f422d5e
commit 96b53f4f30
8 changed files with 515 additions and 482 deletions
+25 -1
View File
@@ -39,7 +39,8 @@ export class ClientsService {
headers.append('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
headers.append('Access-Control-Allow-Origin', '*');
return this.http.get
('https://demo.openmf.org/fineract-provider/api/v1/clients/' + clientId + '?tenantIdentifier=default&pretty=true',
('https://demo.openmf.org/fineract-provider/api/v1/clients/' + clientId
+ '?tenantIdentifier=default&pretty=true',
{headers: headers})
.pipe(
map(
@@ -97,4 +98,27 @@ export class ClientsService {
)
);
}
getClientAddress (clientId: number) {
const username = 'mifos';
const password = 'password';
const headers = new Headers(); // tslint:disable-line
headers.append('Authorization', 'Basic ' + btoa(username + ':' + password));
headers.append('Content-Type', 'application/json');
headers.append('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
headers.append('Access-Control-Allow-Origin', '*');
return this.http.get
('https://demo.openmf.org/fineract-provider/api/v1/client/' + clientId
+ '/addresses' + '?tenantIdentifier=default&pretty=true',
{headers: headers})
.pipe(
map(
(response: Response) => { // tslint:disable-line
response = response.json();
return response;
}
)
);
}
}