| Conditions | 1 |
| Total Lines | 17 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { Injectable } from '@nestjs/common'; |
||
| 34 | |||
| 35 | public findContacts(page: number): Promise<[Contact[], number]> { |
||
| 36 | return this.repository |
||
| 37 | .createQueryBuilder('contact') |
||
| 38 | .select([ |
||
| 39 | 'contact.id', |
||
| 40 | 'contact.firstName', |
||
| 41 | 'contact.lastName', |
||
| 42 | 'contact.company', |
||
| 43 | 'contact.email', |
||
| 44 | 'contact.phoneNumber', |
||
| 45 | 'contact.notes' |
||
| 46 | ]) |
||
| 47 | .orderBy('contact.lastName', 'ASC') |
||
| 48 | .addOrderBy('contact.firstName', 'ASC') |
||
| 49 | .limit(MAX_ITEMS_PER_PAGE) |
||
| 50 | .offset((page - 1) * MAX_ITEMS_PER_PAGE) |
||
| 51 | .getManyAndCount(); |
||
| 54 |