aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/rest/rest.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/core/rest/rest.service.ts')
-rw-r--r--client/src/app/core/rest/rest.service.ts18
1 files changed, 9 insertions, 9 deletions
diff --git a/client/src/app/core/rest/rest.service.ts b/client/src/app/core/rest/rest.service.ts
index b2a5a3f72..fc729f0f6 100644
--- a/client/src/app/core/rest/rest.service.ts
+++ b/client/src/app/core/rest/rest.service.ts
@@ -31,19 +31,19 @@ export class RestService {
31 } 31 }
32 32
33 if (sort !== undefined) { 33 if (sort !== undefined) {
34 let sortString = '' 34 newParams = newParams.set('sort', this.buildSortString(sort))
35 }
35 36
36 if (typeof sort === 'string') { 37 return newParams
37 sortString = sort 38 }
38 } else {
39 const sortPrefix = sort.order === 1 ? '' : '-'
40 sortString = sortPrefix + sort.field
41 }
42 39
43 newParams = newParams.set('sort', sortString) 40 buildSortString (sort: SortMeta | string) {
41 if (typeof sort === 'string') {
42 return sort
44 } 43 }
45 44
46 return newParams 45 const sortPrefix = sort.order === 1 ? '' : '-'
46 return sortPrefix + sort.field
47 } 47 }
48 48
49 addArrayParams (params: HttpParams, name: string, values: (string | number)[]) { 49 addArrayParams (params: HttpParams, name: string, values: (string | number)[]) {