aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/rest/rest-data-source.ts
blob: 57a2efb57bd9f061f9a11901fee78e73f2ab5422 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
export class RestDataSource  {
  // protected addSortRequestOptions (requestOptions: RequestOptionsArgs) {
  //   const searchParams = requestOptions.params as URLSearchParams
  //
  //   if (this.sortConf) {
  //     this.sortConf.forEach((fieldConf) => {
  //       const sortPrefix = fieldConf.direction === 'desc' ? '-' : ''
  //
  //       searchParams.set(this.conf.sortFieldKey, sortPrefix + fieldConf.field)
  //     })
  //   }
  //
  //   return requestOptions
  // }
  //
  // protected addPagerRequestOptions (requestOptions: RequestOptionsArgs) {
  //   const searchParams = requestOptions.params as URLSearchParams
  //
  //   if (this.pagingConf && this.pagingConf['page'] && this.pagingConf['perPage']) {
  //     const perPage = this.pagingConf['perPage']
  //     const page = this.pagingConf['page']
  //
  //     const start = (page - 1) * perPage
  //     const count = perPage
  //
  //     searchParams.set('start', start.toString())
  //     searchParams.set('count', count.toString())
  //   }
  //
  //   return requestOptions
  // }
}