Skip to content

Commit

Permalink
fix: 배너 등록/기간 수정 API 오류 해결 #220
Browse files Browse the repository at this point in the history
  • Loading branch information
Miensoap committed Dec 1, 2024
1 parent 5d637e8 commit 15ac4d7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion backend/src/admin/banner/banner.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class AdminBannerService {
}

async createBanner(createBannerRequest: CreateBannerRequest) {
return this.bannerRepository.create(createBannerRequest);
return this.bannerRepository.save(createBannerRequest);
}

async updateBannerPeriod(
Expand Down
6 changes: 3 additions & 3 deletions backend/src/admin/banner/dto/CreateBannerRequest.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IsUrl, IsDate } from 'class-validator';
import { IsUrl, IsDateString } from 'class-validator';

export class CreateBannerRequest {
@IsUrl()
Expand All @@ -7,9 +7,9 @@ export class CreateBannerRequest {
@IsUrl()
redirectUrl: string;

@IsDate()
@IsDateString()
startedAt: Date;

@IsDate()
@IsDateString()
endedAt: Date;
}
6 changes: 3 additions & 3 deletions backend/src/admin/banner/dto/UpdateBannerPeriodRequest.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { IsDate } from 'class-validator';
import { IsDateString } from 'class-validator';

export class UpdateBannerPeriodRequest {
@IsDate()
@IsDateString()
startedAt: Date;

@IsDate()
@IsDateString()
endedAt: Date;
}

0 comments on commit 15ac4d7

Please sign in to comment.