Skip to content

Commit

Permalink
fix: fix physical address building name validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Brummos committed Jun 10, 2024
1 parent c62d8ca commit b3508c0
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IsNotEmpty, validate, ValidationError } from 'class-validator'
import { IsNotEmpty, Validate, validate, ValidationError } from 'class-validator'
import {
BaseEntity,
BeforeInsert,
Expand All @@ -13,6 +13,7 @@ import {
import { getConstraint } from '../../utils/ValidatorUtils'
import { PhysicalAddressType, ValidationConstraint } from '../../types'
import { PartyEntity } from './PartyEntity'
import { IsNonEmptyStringConstraint } from '../validators'

@Entity('PhysicalAddress')
export class PhysicalAddressEntity extends BaseEntity {
Expand Down Expand Up @@ -48,7 +49,7 @@ export class PhysicalAddressEntity extends BaseEntity {
countryCode!: string

@Column({ name: 'building_name', length: 255, nullable: true })
@IsNotEmpty({ message: 'Blank building names are not allowed' })
@Validate(IsNonEmptyStringConstraint, { message: 'Blank building names are not allowed' })
buildingName?: string

@Column({name: 'owner_id', nullable: true})
Expand Down

0 comments on commit b3508c0

Please sign in to comment.