first draft breadcrumbs

This commit is contained in:
lotte
2020-02-24 16:06:12 +01:00
committed by Art Lowel
parent 725f20a9d0
commit f67387ed65
17 changed files with 197 additions and 191 deletions

View File

@@ -96,13 +96,14 @@ export class RemoteDataBuildService {
const responsePending = hasValue(reqEntry) && hasValue(reqEntry.responsePending) ? reqEntry.responsePending : false;
let isSuccessful: boolean;
let error: RemoteDataError;
if (hasValue(reqEntry) && hasValue(reqEntry.response)) {
isSuccessful = reqEntry.response.isSuccessful;
const errorMessage = isSuccessful === false ? (reqEntry.response as ErrorResponse).errorMessage : undefined;
const response = reqEntry ? reqEntry.response : undefined;
if (hasValue(response)) {
isSuccessful = response.isSuccessful;
const errorMessage = isSuccessful === false ? (response as ErrorResponse).errorMessage : undefined;
if (hasValue(errorMessage)) {
error = new RemoteDataError(
(reqEntry.response as ErrorResponse).statusCode,
(reqEntry.response as ErrorResponse).statusText,
response.statusCode,
response.statusText,
errorMessage
);
}
@@ -112,7 +113,9 @@ export class RemoteDataBuildService {
responsePending,
isSuccessful,
error,
payload
payload,
hasValue(response) ? response.statusCode : undefined
);
})
);