[Library | new-theme]: clear-cache.service.ts: Clear cache only if there is the "deleteCacheUrl" property.
This commit is contained in:
parent
123766d46e
commit
e2792d3be6
|
@ -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)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue