From de1e94ff0b1986abcac46a741a2182b14cb1da3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Tue, 24 Apr 2018 11:20:59 +0200 Subject: [PATCH] Sort by ID rather than date by default --- frontend/src/app/quotes/quotes.component.html | 2 +- frontend/src/app/quotes/quotes.component.ts | 2 +- frontend/src/app/services/quotes.service.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/quotes/quotes.component.html b/frontend/src/app/quotes/quotes.component.html index 071e053..7523cc7 100644 --- a/frontend/src/app/quotes/quotes.component.html +++ b/frontend/src/app/quotes/quotes.component.html @@ -13,7 +13,7 @@ + matSort matSortActive="id" matSortDirection="desc" matSortDisableClear> diff --git a/frontend/src/app/quotes/quotes.component.ts b/frontend/src/app/quotes/quotes.component.ts index f607fb5..0f1db2f 100644 --- a/frontend/src/app/quotes/quotes.component.ts +++ b/frontend/src/app/quotes/quotes.component.ts @@ -53,7 +53,7 @@ export class QuotesComponent implements OnInit, AfterViewInit { ngOnInit() { this.dataSource = new QuotesDataSource(this.quotesService); - this.dataSource.loadQuotes('', 'date', 'desc', 0, 10); + this.dataSource.loadQuotes('', 'id', 'desc', 0, 10); } ngAfterViewInit() { diff --git a/frontend/src/app/services/quotes.service.ts b/frontend/src/app/services/quotes.service.ts index 339d697..07252b4 100644 --- a/frontend/src/app/services/quotes.service.ts +++ b/frontend/src/app/services/quotes.service.ts @@ -20,7 +20,7 @@ export class QuotesService { constructor(private http: HttpClient) { } findQuotes( - filter = '', sortBy = 'date', sortOrder = 'desc', + filter = '', sortBy = 'id', sortOrder = 'desc', pageNumber = 0, pageSize = 10): Observable { return this.http.get('/quotes/api/quotes', {