Skip to content

Commit

Permalink
notice id is number type
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueHorn07 committed Aug 18, 2024
1 parent 431f57b commit e6c8407
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/popo/noticeLike/noticeLike.dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export class NoticeLikeDto {
readonly user_id: string;
readonly notice_id: string;
readonly notice_id: number;
}
2 changes: 1 addition & 1 deletion src/popo/noticeLike/noticeLike.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class NoticeLike {
user_id: string;

@Column({ nullable: false })
notice_id: string;
notice_id: number;

@CreateDateColumn()
created_at: Date;
Expand Down
8 changes: 4 additions & 4 deletions src/popo/noticeLike/noticeLike.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ export class NoticeLikeService {
return this.noticeLikeRepo.save(dto);
}

findByUserIdAndNoticeId(user_id: string, notice_id: string) {
findByUserIdAndNoticeId(user_id: string, notice_id: number) {
return this.noticeLikeRepo.findOne({
where: { user_id: user_id, notice_id: notice_id },
});
}

findAllByNoticeId(notice_id: string) {
findAllByNoticeId(notice_id: number) {
return this.noticeLikeRepo.find({
where: { notice_id: notice_id },
});
}

countLikes(notice_id: string) {
countLikes(notice_id: number) {
return this.noticeLikeRepo.count({ where: { notice_id: notice_id } });
}

delete(user_id: string, notice_id: string) {
delete(user_id: string, notice_id: number) {
return this.noticeLikeRepo.delete({
user_id: user_id,
notice_id: notice_id,
Expand Down

0 comments on commit e6c8407

Please sign in to comment.