-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 📝 Add parmas in swagger for searchapplications
- Loading branch information
1 parent
97ee0fd
commit 39c1270
Showing
4 changed files
with
49 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
<script setup lang="ts"> | ||
import ExportApplications from "@/components/ExportApplications.vue"; | ||
import SearchApplications from "@/components/SearchApplications.vue"; | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<h2>Rechercher une Application</h2> | ||
<ExportApplications /> | ||
<SearchApplications /> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,35 @@ | ||
import { IsOptional, IsString } from 'class-validator'; | ||
// src/application/dto/search-application.dto.ts | ||
|
||
import { ApiPropertyOptional } from '@nestjs/swagger'; | ||
import { IsNumber, IsOptional, IsString, Min } from 'class-validator'; | ||
import { Type } from 'class-transformer'; | ||
|
||
export class SearchApplicationDto { | ||
@ApiPropertyOptional({ | ||
description: "Filtrer par label de l'application", | ||
example: 'Mon Application', | ||
}) | ||
@IsOptional() | ||
@IsString() | ||
label?: string; | ||
|
||
@ApiPropertyOptional({ | ||
description: 'Numéro de la page pour la pagination', | ||
example: 1, | ||
}) | ||
@IsOptional() | ||
@Type(() => Number) // Transformation en nombre | ||
@IsNumber({}, { message: 'Le champ page doit être un nombre valide.' }) | ||
@Min(1, { message: 'Le champ page doit être au moins 1.' }) | ||
page?: number; | ||
|
||
@ApiPropertyOptional({ | ||
description: "Nombre d'éléments par page", | ||
example: 12, | ||
}) | ||
@IsOptional() | ||
@Type(() => Number) // Transformation en nombre | ||
@IsNumber({}, { message: 'Le champ limit doit être un nombre valide.' }) | ||
@Min(1, { message: 'Le champ limit doit être au moins 1.' }) | ||
limit?: number; | ||
} |