[Library | new-theme]: clear-cache.service.ts: Clear cache only if there is the "deleteCacheUrl" property.

This commit is contained in:
Konstantina Galouni 2022-08-08 14:14:43 +03:00
parent 123766d46e
commit e2792d3be6
1 changed files with 5 additions and 3 deletions

View File

@ -10,9 +10,11 @@ export class ClearCacheService {
constructor(private http: HttpClient) {}
clearCache(message: string = null) {
this.http.get(properties.deleteCacheUrl).subscribe(
res => console.log((message ? message+": " : "") + "Cache cleared!"),
err => console.log((message ? message+": " : "") + "Cache could not be cleared ", err)
if(properties.deleteCacheUrl) {
this.http.get(properties.deleteCacheUrl).subscribe(
res => console.log((message ? message + ": " : "") + "Cache cleared!"),
err => console.log((message ? message + ": " : "") + "Cache could not be cleared ", err)
);
}
}
}