aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/rest/rest.service.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-06-16 14:32:15 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-06-16 14:32:15 +0200
commitdf98563e2104b82b119c00a3cd83cd0dc1242d25 (patch)
treea9720bf01bac9ad5646bd3d3c9bc7653617afdad /client/src/app/shared/rest/rest.service.ts
parent46757b477c1adb5f98060d15998a3852e18902a6 (diff)
downloadPeerTube-df98563e2104b82b119c00a3cd83cd0dc1242d25.tar.gz
PeerTube-df98563e2104b82b119c00a3cd83cd0dc1242d25.tar.zst
PeerTube-df98563e2104b82b119c00a3cd83cd0dc1242d25.zip
Use typescript standard and lint all files
Diffstat (limited to 'client/src/app/shared/rest/rest.service.ts')
-rw-r--r--client/src/app/shared/rest/rest.service.ts22
1 files changed, 11 insertions, 11 deletions
diff --git a/client/src/app/shared/rest/rest.service.ts b/client/src/app/shared/rest/rest.service.ts
index 16b47e957..43dc20b34 100644
--- a/client/src/app/shared/rest/rest.service.ts
+++ b/client/src/app/shared/rest/rest.service.ts
@@ -1,27 +1,27 @@
1import { Injectable } from '@angular/core'; 1import { Injectable } from '@angular/core'
2import { URLSearchParams } from '@angular/http'; 2import { URLSearchParams } from '@angular/http'
3 3
4import { RestPagination } from './rest-pagination'; 4import { RestPagination } from './rest-pagination'
5 5
6@Injectable() 6@Injectable()
7export class RestService { 7export class RestService {
8 8
9 buildRestGetParams(pagination?: RestPagination, sort?: string) { 9 buildRestGetParams (pagination?: RestPagination, sort?: string) {
10 const params = new URLSearchParams(); 10 const params = new URLSearchParams()
11 11
12 if (pagination) { 12 if (pagination) {
13 const start: number = (pagination.currentPage - 1) * pagination.itemsPerPage; 13 const start: number = (pagination.currentPage - 1) * pagination.itemsPerPage
14 const count: number = pagination.itemsPerPage; 14 const count: number = pagination.itemsPerPage
15 15
16 params.set('start', start.toString()); 16 params.set('start', start.toString())
17 params.set('count', count.toString()); 17 params.set('count', count.toString())
18 } 18 }
19 19
20 if (sort) { 20 if (sort) {
21 params.set('sort', sort); 21 params.set('sort', sort)
22 } 22 }
23 23
24 return params; 24 return params
25 } 25 }
26 26
27} 27}