This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
search-service.ts 968 B
Newer Older
Michael Breu's avatar
Michael Breu committed
import { Injectable } from '@angular/core';
import { HttpClient, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';

import { SERVER_API_URL } from 'app/app.constants';
import { createRequestOption } from 'app/shared/util/request-util';
import { SearchResultsDTO } from 'app/shared/model/search/search-results-dto.model';
import { SearchInput } from 'app/shared/model/search-input.model';

type EntityResponseTypePageDetails = HttpResponse<SearchResultsDTO>;

@Injectable({ providedIn: 'root' })
export class SearchService {
  public resourceSearchUrlPageDetails = SERVER_API_URL + 'api/search/page-details';

  constructor(protected http: HttpClient) {}

  searchPageDetails(searchInput: SearchInput): Observable<SearchResultsDTO> {
    const req = {
      query: searchInput
    };
//    const options = createRequestOption(req);
    return this.http
      .post<SearchResultsDTO>(this.resourceSearchUrlPageDetails, searchInput);
  }


}