[DURACOM-151] reverted setStaleByUUID method as it was

This commit is contained in:
Alisa Ismailati
2023-06-06 16:57:17 +02:00
parent 1b2d9829ed
commit b1aa2f3550
3 changed files with 6 additions and 4 deletions

View File

@@ -495,7 +495,6 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
).subscribe(({ restResponse, eperson }: { restResponse: RemoteData<NoContent> | null, eperson: EPerson }) => {
if (restResponse?.hasSucceeded) {
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.deleted.success', { name: this.dsoNameService.getName(eperson) }));
this.submitForm.emit();
} else {
this.notificationsService.error(`Error occurred when trying to delete EPerson with id: ${eperson?.id} with code: ${restResponse?.statusCode} and message: ${restResponse?.errorMessage}`);
}

View File

@@ -627,8 +627,11 @@ describe('RequestService', () => {
it('should return an Observable that emits true as soon as the request is stale', fakeAsync(() => {
dispatchSpy.and.callFake(() => { /* empty */ }); // don't actually set as stale
getByUUIDSpy.and.returnValue(cold('-----(a|)', { // but fake the state in the cache
a: { state: RequestEntryState.SuccessStale },
getByUUIDSpy.and.returnValue(cold('a-b--c--d-', { // but fake the state in the cache
a: { state: RequestEntryState.ResponsePending },
b: { state: RequestEntryState.Success },
c: { state: RequestEntryState.SuccessStale },
d: { state: RequestEntryState.Error },
}));
const done$ = service.setStaleByUUID('something');

View File

@@ -328,9 +328,9 @@ export class RequestService {
this.store.dispatch(new RequestStaleAction(uuid));
return this.getByUUID(uuid).pipe(
take(1),
map((request: RequestEntry) => isStale(request.state)),
filter((stale: boolean) => stale),
take(1),
);
}