feat: view client layout implemented (#93)

* view client layout implemented
This commit is contained in:
Anwesh Nayak
2018-07-04 07:30:25 +05:30
committed by GitHub
parent 8aea96449a
commit 9f1df583a5
11 changed files with 404 additions and 171 deletions
+69 -2
View File
@@ -9,7 +9,7 @@ import { map } from 'rxjs/operators';
@Injectable()
export class ClientsService {
constructor(private http: Http) {} // tslint:disable-line
getServer() {
getClients() {
const username = 'mifos';
const password = 'password';
const headers = new Headers(); // tslint:disable-line
@@ -18,7 +18,7 @@ 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://mobile.openmf.org/fineract-provider/api/v1/clients?tenantIdentifier=mobile&pretty=true',
('https://demo.openmf.org/fineract-provider/api/v1/clients?tenantIdentifier=default&pretty=true',
{headers: headers})
.pipe(
map(
@@ -30,4 +30,71 @@ export class ClientsService {
)
);
}
getClientId(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/clients/' + clientId + '?tenantIdentifier=default&pretty=true',
{headers: headers})
.pipe(
map(
(response: Response) => { // tslint:disable-line
response = response.json();
return response;
}
)
);
}
getClientAccounts(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/clients/' + clientId
+ '/accounts' + '?tenantIdentifier=default&pretty=true',
{headers: headers})
.pipe(
map(
(response: Response) => { // tslint:disable-line
response = response.json();
return response;
}
)
);
}
getClientCharges(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/clients/' + clientId
+ '/charges' + '?tenantIdentifier=default&pretty=true',
{headers: headers})
.pipe(
map(
(response: Response) => { // tslint:disable-line
response = response.json();
return response;
}
)
);
}
}