|
|
@ -9,10 +9,7 @@ import { Observable } from 'rxjs/Observable';
|
|
|
|
|
|
|
|
|
|
|
|
import { map } from 'rxjs/operators';
|
|
|
|
import { map } from 'rxjs/operators';
|
|
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
import { Quote } from '../models/quote';
|
|
|
|
Quotes,
|
|
|
|
|
|
|
|
Quote
|
|
|
|
|
|
|
|
} from '../models/quotes';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
@Injectable()
|
|
|
@ -21,7 +18,7 @@ export class QuotesService {
|
|
|
|
|
|
|
|
|
|
|
|
findQuotes(
|
|
|
|
findQuotes(
|
|
|
|
filter = '', sortBy = 'id', sortOrder = 'desc',
|
|
|
|
filter = '', sortBy = 'id', sortOrder = 'desc',
|
|
|
|
pageNumber = 0, pageSize = 20): Observable<Quotes> {
|
|
|
|
pageNumber = 0, pageSize = 20): Observable<any> {
|
|
|
|
|
|
|
|
|
|
|
|
return this.http.get('/quotes/api/quotes', {
|
|
|
|
return this.http.get('/quotes/api/quotes', {
|
|
|
|
observe: 'response',
|
|
|
|
observe: 'response',
|
|
|
@ -32,10 +29,10 @@ export class QuotesService {
|
|
|
|
.set('page_number', pageNumber.toString())
|
|
|
|
.set('page_number', pageNumber.toString())
|
|
|
|
.set('page_size', pageSize.toString())
|
|
|
|
.set('page_size', pageSize.toString())
|
|
|
|
}).pipe(
|
|
|
|
}).pipe(
|
|
|
|
map(res => <Quotes>{
|
|
|
|
map(res => ({
|
|
|
|
quotes: <Quote[]>res.body,
|
|
|
|
quotes: <Quote[]>res.body,
|
|
|
|
totalCount: parseInt(res.headers.get('X-Total-Count'))
|
|
|
|
totalCount: parseInt(res.headers.get('X-Total-Count'))
|
|
|
|
})
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|