From 795b0a37b46c839d98a2bf78e4c5b43183595bbd Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Thu, 15 Feb 2024 11:59:23 +0100 Subject: [PATCH] [DSC-1111] Fix issue with wrong cache reference --- .../comcol/comcol-forms/comcol-form/comcol-form.component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.ts b/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.ts index bb4ba7cef0..d060cb4ad1 100644 --- a/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.ts +++ b/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.ts @@ -242,6 +242,7 @@ export class ComColFormComponent implements On getFirstCompletedRemoteData() ).subscribe((response: RemoteData) => { if (response.hasSucceeded) { + this.refreshCache(); this.notificationsService.success( this.translate.get(this.type.value + '.edit.logo.notifications.delete.success.title'), this.translate.get(this.type.value + '.edit.logo.notifications.delete.success.content') @@ -254,7 +255,7 @@ export class ComColFormComponent implements On } this.dso.logo = undefined; this.uploadFilesOptions.method = RestRequestMethod.POST; - this.finish.emit(); + // this.finish.emit(); }); } else if (result === 'cancel') { @@ -270,7 +271,7 @@ export class ComColFormComponent implements On * Refresh the object's cache to ensure the latest version */ private refreshCache() { - this.requestService.removeByHrefSubstring(this.dso._links.self.href); + this.requestService.setStaleByHrefSubstring(this.dso.id); this.objectCache.remove(this.dso._links.self.href); this.dsoService.findById(this.dso.id, false, true, followLink('logo')).pipe( getFirstCompletedRemoteData()