Fix $unload from cache

pull/4713/head
Oliver Günther 8 years ago
parent 57eaa5d0cf
commit 4d2bcc35e2
  1. 7
      frontend/app/components/api/api-v3/hal-resources/hal-resource.service.ts
  2. 2
      frontend/app/components/work-packages/work-package-cache.service.ts

@ -102,7 +102,7 @@ export class HalResource {
// Reset and load this resource
this.$loaded = false;
this.$self = this.$links.self({}, this.$loadHeaders(true)).then(source => {
this.$self = this.$links.self({}, this.$loadHeaders(force)).then(source => {
this.$loaded = true;
this.$initialize(source);
return this;
@ -111,11 +111,6 @@ export class HalResource {
return this.$self;
}
public $unload() {
this.$loaded = false;
this.$self = null;
}
public $plain() {
return angular.copy(this.$source);
}

@ -74,7 +74,7 @@ export class WorkPackageCacheService {
*/
loadWorkPackageLinks(workPackage, ...args: string[]) {
args.forEach((arg) => {
workPackage[arg].$unload();
workPackage[arg].$load(true);
});
return this.updateWorkPackage(workPackage);
}

Loading…
Cancel
Save