Skip to content

Commit

Permalink
antaresKey is optional now
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfganggreschus committed Sep 28, 2023
1 parent 559d8ed commit 862e587
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApiProperty } from '@nestjs/swagger';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { DecodeHtmlEntities } from '@shared/controller';
import { IsNumber, IsString } from 'class-validator';

Expand All @@ -17,8 +17,8 @@ export class CountyResponse {
@IsNumber()
countyId: number;

@ApiProperty()
@ApiPropertyOptional()
@IsString()
@DecodeHtmlEntities()
antaresKey: string;
antaresKey?: string;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApiProperty } from '@nestjs/swagger';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { DecodeHtmlEntities } from '@shared/controller';
import { IsNumber, IsString } from 'class-validator';

Expand All @@ -18,10 +18,9 @@ export class CreateCountyBodyParams {

@IsString()
@DecodeHtmlEntities()
@ApiProperty({
@ApiPropertyOptional({
description: 'Antares key of the county',
required: true,
type: String,
})
antaresKey!: string;
antaresKey?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AuthorizableObject, DomainObject } from '@shared/domain/domain-object';
export interface ICounty {
countyId: number;
name: string;
antaresKey: string;
antaresKey?: string;
}
export interface FederalStateProps extends AuthorizableObject {
name: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class County {
countyId: number;

@Property()
antaresKey: string;
antaresKey?: string;
}

@Entity({ tableName: 'federalstates' })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export interface ICountyCreate {
name: string;
countyId: number;
antaresKey: string;
antaresKey?: string;
}

export interface IFederalStateCreate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export class FederalStateService {
return federalState;
}

async findAll() {
const federalStates: FederalStateDO[] = await this.federalStateRepo.findAll();
async findAll(): Promise<FederalStateDO[]> {
const federalStates = await this.federalStateRepo.findAll();
return federalStates;
}

Expand Down

0 comments on commit 862e587

Please sign in to comment.