From b1515cd395d84dae6de8ced6c67f8e71b8faa9cf Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 12 Jul 2022 16:50:56 +0300 Subject: [PATCH] [Library & Connect Admin | new-theme]: edit-community.component.ts & portals.component.ts & pages.component.ts & page-help-content-form.component.ts & page-help-contents.component.ts & entities.component.ts & divIds.component.ts & class-help-content-form.component.ts & class-help-contents.component.ts: On save/update/delete/toggle community/page/entity/divId/helptext/divHelptext , call clearCache() to immediately get changes in the dashboards. --- .../profile/edit-community/edit-community.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/pages/community-info/profile/edit-community/edit-community.component.ts b/src/app/pages/community-info/profile/edit-community/edit-community.component.ts index 5476eb8..98633dd 100644 --- a/src/app/pages/community-info/profile/edit-community/edit-community.component.ts +++ b/src/app/pages/community-info/profile/edit-community/edit-community.component.ts @@ -11,6 +11,7 @@ import {StringUtils} from "../../../../openaireLibrary/utils/string-utils.class" import {Subscription} from "rxjs"; import {Option} from "../../../../openaireLibrary/sharedComponents/input/input.component"; import {NotificationHandler} from "../../../../openaireLibrary/utils/notification-handler"; +import {ClearCacheService} from "../../../../openaireLibrary/services/clear-cache.service"; @Component({ selector: 'edit-community', @@ -111,7 +112,8 @@ export class EditCommunityComponent { constructor(private fb: FormBuilder, private communityService: CommunityService, private utilsService: UtilitiesService, - private userManagementService: UserManagementService) { + private userManagementService: UserManagementService, + private _clearCacheService: ClearCacheService) { } ngOnDestroy() { @@ -211,6 +213,7 @@ export class EditCommunityComponent { this.removePhoto(); this.subscriptions.push(this.communityService.updateCommunity( this.properties.communityAPI + this.community.communityId, this.communityFb.getRawValue()).subscribe(() => { + this._clearCacheService.clearCache("Community saved"); this.communityService.getCommunity(this.community.communityId, true).subscribe(community => { NotificationHandler.rise(community.shortTitle + ' has been successfully created'); callback(community); @@ -223,6 +226,7 @@ export class EditCommunityComponent { })); } else { this.subscriptions.push(this.communityService.updateCommunity(this.properties.communityAPI + this.community.communityId, this.communityFb.getRawValue()).subscribe(() => { + this._clearCacheService.clearCache("Community updated"); this.communityService.getCommunity(this.community.communityId, true).subscribe(community => { NotificationHandler.rise(community.shortTitle + ' has been successfully saved'); callback(community);