Skip to content

Commit b1aa2f3

Browse files
[DURACOM-151] reverted setStaleByUUID method as it was
1 parent 1b2d982 commit b1aa2f3

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,6 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
495495
).subscribe(({ restResponse, eperson }: { restResponse: RemoteData<NoContent> | null, eperson: EPerson }) => {
496496
if (restResponse?.hasSucceeded) {
497497
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.deleted.success', { name: this.dsoNameService.getName(eperson) }));
498-
this.submitForm.emit();
499498
} else {
500499
this.notificationsService.error(`Error occurred when trying to delete EPerson with id: ${eperson?.id} with code: ${restResponse?.statusCode} and message: ${restResponse?.errorMessage}`);
501500
}

src/app/core/data/request.service.spec.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,8 +627,11 @@ describe('RequestService', () => {
627627

628628
it('should return an Observable that emits true as soon as the request is stale', fakeAsync(() => {
629629
dispatchSpy.and.callFake(() => { /* empty */ }); // don't actually set as stale
630-
getByUUIDSpy.and.returnValue(cold('-----(a|)', { // but fake the state in the cache
631-
a: { state: RequestEntryState.SuccessStale },
630+
getByUUIDSpy.and.returnValue(cold('a-b--c--d-', { // but fake the state in the cache
631+
a: { state: RequestEntryState.ResponsePending },
632+
b: { state: RequestEntryState.Success },
633+
c: { state: RequestEntryState.SuccessStale },
634+
d: { state: RequestEntryState.Error },
632635
}));
633636

634637
const done$ = service.setStaleByUUID('something');

src/app/core/data/request.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,9 @@ export class RequestService {
328328
this.store.dispatch(new RequestStaleAction(uuid));
329329

330330
return this.getByUUID(uuid).pipe(
331-
take(1),
332331
map((request: RequestEntry) => isStale(request.state)),
333332
filter((stale: boolean) => stale),
333+
take(1),
334334
);
335335
}
336336

0 commit comments

Comments
 (0)