mohammadjouhari opened this issue 5 years ago · 1 comments
Dear Developers,
Hope evrything is fine.
clicking your feed not filtirring data.
Any reason ?
I fixed the issue by modifying the constructor ( private apiService: ApiService, private userService: UserService ) {} currentUser: User; query(config: ArticleListConfig): Observable<{articles: Article[], articlesCount: number}> { console.log(config); const params = {}; if((config.type != 'feed')) { Object.keys(config.filters) .forEach((key) => { params[key] = config.filters[key]; }); return this.apiService .get( '/articles', new HttpParams({ fromObject: params }) ); } else { this.userService.currentUser.subscribe( (userData) => { this.currentUser = userData; } ); params['author'] = this.currentUser.username; return this.apiService .get( '/articles', new HttpParams({ fromObject: params }) ); } }