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

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

View File

@ -30,5 +30,3 @@ docker run -it -v /home/tanshu/Programming/luthor/DB/csv:/mnt --link postgres:db
sed -i 's/\x0//g' /home/tanshu/Programming/luthor/DB/csv/o-hearings.csv sed -i 's/\x0//g' /home/tanshu/Programming/luthor/DB/csv/o-hearings.csv
docker run -it -v /home/tanshu/Programming/luthor/DB/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres luthor -c "\copy hearings(old_id, old_case_id, judges, brief, next_hearing_date, old_court_status_id, court_number, item_number) from /mnt/o-hearings.csv with delimiter E'\''\t'\'' null as '\'''\''"' docker run -it -v /home/tanshu/Programming/luthor/DB/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres luthor -c "\copy hearings(old_id, old_case_id, judges, brief, next_hearing_date, old_court_status_id, court_number, item_number) from /mnt/o-hearings.csv with delimiter E'\''\t'\'' null as '\'''\''"'
alembic upgrade 87a06eaadd34 alembic upgrade 87a06eaadd34
#docker run -it -v /home/tanshu/Programming/luthor/DB/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres luthor -c "\copy section_printers(id, menu_category_id, section_name, printer_name, copies) from /mnt/o-SectionPrinters.csv"'
#alembic upgrade 48bc1c7c07ce

View File

@ -13,6 +13,6 @@ export class CaseListResolver implements Resolve<Case[]> {
constructor(private ser: CaseService) {} constructor(private ser: CaseService) {}
resolve(): Observable<Case[]> { 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>; .pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable<Case>;
} }
list(caseSource: string | null): Observable<Case[]> { list(caseSource: string): Observable<Case[]> {
const listUrl: string = caseSource === null ? `${url}/list` : `${url}/list/${caseSource}`; const listUrl: string = caseSource === '' ? `${url}/list` : `${url}/list/${caseSource}`;
return this.http return this.http
.get<Case[]>(listUrl) .get<Case[]>(listUrl)
.pipe(catchError(this.log.handleError(serviceName, 'list'))) as Observable<Case[]>; .pipe(catchError(this.log.handleError(serviceName, 'list'))) as Observable<Case[]>;