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);