Fix Case list was appending / at the end as the value was not null it was an empty string.

This commit is contained in:
2021-01-11 12:08:53 +05:30
parent ee9a0eb86f
commit ff547719b2
3 changed files with 3 additions and 5 deletions

View File

@ -13,6 +13,6 @@ export class CaseListResolver implements Resolve<Case[]> {
constructor(private ser: CaseService) {}
resolve(): Observable<Case[]> {
return this.ser.list(null);
return this.ser.list('');
}
}

View File

@ -25,8 +25,8 @@ export class CaseService {
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable<Case>;
}
list(caseSource: string | null): Observable<Case[]> {
const listUrl: string = caseSource === null ? `${url}/list` : `${url}/list/${caseSource}`;
list(caseSource: string): Observable<Case[]> {
const listUrl: string = caseSource === '' ? `${url}/list` : `${url}/list/${caseSource}`;
return this.http
.get<Case[]>(listUrl)
.pipe(catchError(this.log.handleError(serviceName, 'list'))) as Observable<Case[]>;