i wanted the page to reload if there is no data in the api
ngOnInit(): void {
this.activatedRoute.queryParams.subscribe((params: any) => {
this.fill = params.data;
params = {
keyword: this.fill
}
this.jobService.searchJobs(params).subscribe(
(response: any) => {
this.jobSearchModel.recentJobs = response.data;
},
(error) => {
window.location.reload();
})
})
}
i've tried this but the page keep reloading forever, how can i refresh the page only for one time?