UNPKG

@lxdhub/api

Version:

Display, search and copy LXD-images using a web interface.

23 lines (21 loc) 692 B
import { EntityRepository, Repository } from 'typeorm'; import { SyncRun } from '@lxdhub/db'; import { PaginationOptionsDto } from '../common'; /** * This repository represents the interface between the appliaction * repository entity and the database. */ @EntityRepository(SyncRun) export class SyncRunRepository extends Repository<SyncRun> { /** * Paginate through syncronization runs * @param pagination The pagination options */ paginate(pagination: PaginationOptionsDto): Promise<[SyncRun[], number]> { return this.createQueryBuilder() .offset(pagination.offset) .limit(pagination.limit) .orderBy('created', 'DESC') .getManyAndCount(); } }