Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel committed Feb 13, 2024
1 parent 89eee0e commit 6b94b8c
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import { Action } from '@narval/authz-shared'
import { ApiProperty } from '@nestjs/swagger'
import { Type } from 'class-transformer'
import { ArrayNotEmpty, IsDefined, IsNotEmpty, IsString, Matches, ValidateNested } from 'class-validator'
import { IsArray, IsDefined, IsString, Matches, ValidateNested } from 'class-validator'
import { Policy } from '../../../../../shared/types/policy.type'
import { BaseActionDto } from '../base-action.dto'
import { BaseAdminRequestPayloadDto } from '../base-admin-request-payload.dto'

export class SetPolicyRulesDto extends BaseActionDto {
@IsDefined()
@IsString()
@IsNotEmpty()
@Matches(Action.SET_POLICY_RULES)
@ApiProperty()
action: typeof Action.SET_POLICY_RULES

@ArrayNotEmpty()
@ValidateNested({ each: true })
@IsDefined()
@IsArray()
@Type(() => Policy)
@ValidateNested({ each: true })
@ApiProperty()
data: Policy[]
}
Expand All @@ -24,6 +25,6 @@ export class SetPolicyRulesRequestDto extends BaseAdminRequestPayloadDto {
@IsDefined()
@ValidateNested()
@Type(() => SetPolicyRulesDto)
@ApiProperty({ type: () => SetPolicyRulesDto })
@ApiProperty()
request: SetPolicyRulesDto
}

0 comments on commit 6b94b8c

Please sign in to comment.