From 1127b363e90ba4377cab130d8cdea42c75d3699a Mon Sep 17 00:00:00 2001 From: Corrado Lombardi Date: Thu, 22 Oct 2020 15:45:39 +0200 Subject: [PATCH] [CSTPER-66] function to get succeeded or no content response --- src/app/core/shared/operators.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app/core/shared/operators.ts b/src/app/core/shared/operators.ts index ad2588f2b9..203f66b074 100644 --- a/src/app/core/shared/operators.ts +++ b/src/app/core/shared/operators.ts @@ -75,6 +75,11 @@ export const getSucceededRemoteWithNotEmptyData = () => (source: Observable>): Observable> => source.pipe(find((rd: RemoteData) => rd.hasSucceeded && isNotEmpty(rd.payload))); +export const getSucceededOrNoContentResponse = () => + (source: Observable>): Observable> => + source.pipe(find((rd: RemoteData) => rd.hasSucceeded || rd.hasNoContent)); + + /** * Get the first successful remotely retrieved object *