Fix undefined param submit for GET users
parent
229b133777
commit
0c04cd7f8f
|
@ -21,11 +21,17 @@ export class UserService {
|
|||
}
|
||||
|
||||
findUsers(filter, limit?, offset?, action = LOAD): Observable<User[]> {
|
||||
let searchParams = new HttpParams().append('q', (filter && filter.query) ? filter.query : '')
|
||||
.append('limit', limit)
|
||||
.append('offset', offset);
|
||||
|
||||
let searchParams = new HttpParams();
|
||||
if (limit) {
|
||||
searchParams = searchParams.append('limit', limit);
|
||||
}
|
||||
if (offset) {
|
||||
searchParams = searchParams.append('offset', offset);
|
||||
}
|
||||
if (filter) {
|
||||
if (filter.query) {
|
||||
searchParams = searchParams.append('q', filter.query);
|
||||
}
|
||||
if (filter.fraction) {
|
||||
searchParams = searchParams.append('fractFilter', filter.fraction);
|
||||
}
|
||||
|
@ -37,7 +43,6 @@ export class UserService {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
this.httpGateway.get<Response>(this.config.apiUserPath, searchParams, true)
|
||||
.do((res) => {
|
||||
const headerCount = parseInt(res.headers.get('x-total-count'), 10);
|
||||
|
@ -47,7 +52,6 @@ export class UserService {
|
|||
})
|
||||
.map(res => res.body)
|
||||
.do((users) => {
|
||||
console.log(users)
|
||||
this.userStore.dispatch({type: action, data: users});
|
||||
}).subscribe(_ => {
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue