diff --git a/src/templates/core/angular/request.hbs b/src/templates/core/angular/request.hbs index ff3e410a..e6cdb293 100644 --- a/src/templates/core/angular/request.hbs +++ b/src/templates/core/angular/request.hbs @@ -67,43 +67,43 @@ import type { OpenAPIConfig } from './OpenAPI'; * @throws ApiError */ export const request = (config: OpenAPIConfig, http: HttpClient, options: ApiRequestOptions): Observable => { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); - return getHeaders(config, options).pipe( - mergeMap( headers => { - return sendRequest(config, options, http, url, formData, body, headers); - }), - map(response => { - const responseBody = getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - return { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? responseBody, - } as ApiResult; - }), - catchError((error: HttpErrorResponse) => { - if (!error.status) { - return throwError(() => error); - } - return of({ - url, - ok: error.ok, - status: error.status, - statusText: error.statusText, - body: error.statusText, - } as ApiResult); - }), - map(result => { - catchErrorCodes(options, result); - return result.body as T; - }), - catchError((error: ApiError) => { - return throwError(() => error); - }), - ); + return getHeaders(config, options).pipe( + mergeMap(headers => { + return sendRequest(config, options, http, url, formData, body, headers); + }), + map(response => { + const responseBody = getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + return { + url, + ok: response.ok, + status: response.status, + statusText: response.statusText, + body: responseHeader ?? responseBody, + } as ApiResult; + }), + catchError((error: HttpErrorResponse) => { + if (!error.status) { + return throwError(() => error); + } + return of({ + url, + ok: error.ok, + status: error.status, + statusText: error.statusText, + body: error.statusText, + } as ApiResult); + }), + map(result => { + catchErrorCodes(options, result); + return result.body as T; + }), + catchError((error: ApiError) => { + return throwError(() => error); + }), + ); };