mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 23:43:01 +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 }) => {
|
).subscribe(({ restResponse, eperson }: { restResponse: RemoteData<NoContent> | null, eperson: EPerson }) => {
|
||||||
if (restResponse?.hasSucceeded) {
|
if (restResponse?.hasSucceeded) {
|
||||||
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.deleted.success', { name: this.dsoNameService.getName(eperson) }));
|
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.deleted.success', { name: this.dsoNameService.getName(eperson) }));
|
||||||
this.submitForm.emit();
|
|
||||||
} else {
|
} else {
|
||||||
this.notificationsService.error(`Error occurred when trying to delete EPerson with id: ${eperson?.id} with code: ${restResponse?.statusCode} and message: ${restResponse?.errorMessage}`);
|
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(() => {
|
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
|
dispatchSpy.and.callFake(() => { /* empty */ }); // don't actually set as stale
|
||||||
getByUUIDSpy.and.returnValue(cold('-----(a|)', { // but fake the state in the cache
|
getByUUIDSpy.and.returnValue(cold('a-b--c--d-', { // but fake the state in the cache
|
||||||
a: { state: RequestEntryState.SuccessStale },
|
a: { state: RequestEntryState.ResponsePending },
|
||||||
|
b: { state: RequestEntryState.Success },
|
||||||
|
c: { state: RequestEntryState.SuccessStale },
|
||||||
|
d: { state: RequestEntryState.Error },
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const done$ = service.setStaleByUUID('something');
|
const done$ = service.setStaleByUUID('something');
|
||||||
|
@@ -328,9 +328,9 @@ export class RequestService {
|
|||||||
this.store.dispatch(new RequestStaleAction(uuid));
|
this.store.dispatch(new RequestStaleAction(uuid));
|
||||||
|
|
||||||
return this.getByUUID(uuid).pipe(
|
return this.getByUUID(uuid).pipe(
|
||||||
take(1),
|
|
||||||
map((request: RequestEntry) => isStale(request.state)),
|
map((request: RequestEntry) => isStale(request.state)),
|
||||||
filter((stale: boolean) => stale),
|
filter((stale: boolean) => stale),
|
||||||
|
take(1),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user