mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 15:33:04 +00:00
[DURACOM-151] reverted setStaleByUUID method as it was
This commit is contained in:
@@ -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}`);
|
||||
}
|
||||
|
@@ -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');
|
||||
|
@@ -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),
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user