### File

`src/core/domain/dtos/page.dto.ts`

### Description

Page model for pagination

### Index

###### Properties

- Readonly data
- Readonly meta

### Constructor

`constructor(data: PaperDto[], meta: PageMetaDto)`
Defined in src/core/domain/dtos/page.dto.ts:35

Constructs an object with provided parameters

Parameters :

Name | Type | Optional
data | `PaperDto[]` | No
meta | `PageMetaDto` | No

### Properties

Readonly data
Type : `PaperDto[]`
Decorators : `@IsArray() @ApiProperty({description: 'All data (papers) the page contains', isArray: true, type: PaperDto})`
Defined in src/core/domain/dtos/page.dto.ts:25
Data block of the page

Readonly meta
Type : `PageMetaDto`
Decorators : `@ApiProperty({description: 'Metadata for the page', type: PageMetaDto})`
Defined in src/core/domain/dtos/page.dto.ts:35
Metadata of the page

    import { ApiExtraModels, ApiProperty, PartialType } from "@nestjs/swagger";
    import { IsArray } from "class-validator";
    import { PageMetaDto } from "./page-meta.dto";
    import { PaperDto } from "./paper.dto";

    /**
     * List of allowed properties in this DTO
     */
    const allowedProperties = ['data', 'meta'];

    /**
     * Page model for pagination
     */
    @ApiExtraModels()
    export class PageDto {
        /**
         * Data block of the page
         */
        @IsArray()
        @ApiProperty({
            description: 'All data (papers) the page contains',
            isArray: true,
            type: PaperDto,
        })
        readonly data: PaperDto[];

        /**
         * Metadata of the page
         */
        @ApiProperty({
            description: 'Metadata for the page',
            type: PageMetaDto,

        })
        readonly meta: PageMetaDto;

        /**
         * Constructs an object with provided parameters
         * @param data
         * @param meta
         */
        constructor(data: PaperDto[], meta: PageMetaDto) {
            this.data = data;
            this.meta = meta;
        }
    }

# results matching ""

# No results matching ""