| Conditions | 1 | 
| Total Lines | 17 | 
| Code Lines | 16 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | import { Injectable } from '@nestjs/common'; | ||
| 18 | |||
| 19 |   public findContacts(page: number): Promise<[Contact[], number]> { | ||
| 20 | return this.repository | ||
| 21 |       .createQueryBuilder('contact') | ||
| 22 | .select([ | ||
| 23 | 'contact.id', | ||
| 24 | 'contact.firstName', | ||
| 25 | 'contact.lastName', | ||
| 26 | 'contact.company', | ||
| 27 | 'contact.email', | ||
| 28 | 'contact.phoneNumber', | ||
| 29 | 'contact.notes' | ||
| 30 | ]) | ||
| 31 |       .orderBy('contact.lastName', 'ASC') | ||
| 32 |       .addOrderBy('contact.firstName', 'ASC') | ||
| 33 | .limit(MAX_ITEMS_PER_PAGE) | ||
| 34 | .offset((page - 1) * MAX_ITEMS_PER_PAGE) | ||
| 35 | .getManyAndCount(); | ||
| 38 |