[Connect Admin | Library | new-theme]: Updated call for purging browser cache - through admin tools api.

1. environment.ts & environment.beta.ts: Updated property "deleteBrowserCacheUrl" to call admin tools api.
2. clear-cache.service.ts: Used updated property "deleteBrowserCacheUrl" and in GET request added CustomOptions.registryOptions().
3. connect-admin-customization.component.ts: Deleted unnecessary code for deleting layout.
This commit is contained in:
Konstantina Galouni 2022-08-11 15:46:55 +03:00
parent 27d7c7c118
commit 561c15b8cd
1 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import {Injectable} from "@angular/core";
import {HttpClient} from "@angular/common/http";
import {properties} from "../../../environments/environment";
import {CustomOptions} from "./servicesUtils/customOptions.class";
@Injectable({
providedIn: 'root'
@ -20,8 +21,9 @@ export class ClearCacheService {
purgeBrowserCache(message: string = null, pid: string) {
if(properties.deleteBrowserCacheUrl) {
let url = properties.deleteBrowserCacheUrl.replace("{pid}", pid);
this.http.get(url).subscribe(
let url = properties.deleteBrowserCacheUrl + "/" + pid;
this.http.get(url, CustomOptions.registryOptions()).subscribe(
res => console.log((message ? message + ": " : "") + "Browser Cache purged!"),
err => console.log((message ? message + ": " : "") + "Browser Cache could not be purged ", err)
);