Merge branch 'master' into angular-cli

This commit is contained in:
lotte
2020-03-31 13:49:40 +02:00
72 changed files with 2709 additions and 415 deletions

View File

@@ -9,6 +9,7 @@ import { AuthGetRequest, AuthPostRequest, GetRequest, PostRequest, RestRequest }
import { AuthStatusResponse, ErrorResponse } from '../cache/response.models';
import { HttpOptions } from '../dspace-rest-v2/dspace-rest-v2.service';
import { getResponseFromEntry } from '../shared/operators';
import { HttpClient } from '@angular/common/http';
@Injectable()
export class AuthRequestService {
@@ -16,7 +17,8 @@ export class AuthRequestService {
protected browseEndpoint = '';
constructor(protected halService: HALEndpointService,
protected requestService: RequestService) {
protected requestService: RequestService,
private http: HttpClient) {
}
protected fetchRequest(request: RestRequest): Observable<any> {
@@ -36,7 +38,7 @@ export class AuthRequestService {
return isNotEmpty(method) ? `${endpoint}/${method}` : `${endpoint}`;
}
public postToEndpoint(method: string, body: any, options?: HttpOptions): Observable<any> {
public postToEndpoint(method: string, body?: any, options?: HttpOptions): Observable<any> {
return this.halService.getEndpoint(this.linkName).pipe(
filter((href: string) => isNotEmpty(href)),
map((endpointURL) => this.getEndpointByMethod(endpointURL, method)),