Skip to content

Commit

Permalink
fix(blogs): Revert deletion of updated_at property and unnecessary …
Browse files Browse the repository at this point in the history
…additions
  • Loading branch information
sage-ali committed Mar 2, 2025
1 parent c4983f0 commit abfd92a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion src/modules/blogs/blogs.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class BlogService {
throw new CustomHttpException(SYS_MSG.BLOG_NOT_FOUND, HttpStatus.NOT_FOUND);
}

const { id, created_at, ...rest } = singleBlog;
const { id, created_at, updated_at, ...rest } = singleBlog;
const author = `${fullName.first_name} ${fullName.last_name}`;

return {
Expand Down
3 changes: 0 additions & 3 deletions src/modules/blogs/dtos/blog-response.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ export class BlogResponseDto {
@ApiProperty({ description: 'The published date of the blog' })
published_date?: Date;

@ApiProperty({ description: 'The last updated date of the blog' })
last_updated_date?: Date;

@ApiProperty({ description: 'The deletion date of the blog', required: false })
deletedAt?: Date;
}
8 changes: 0 additions & 8 deletions src/modules/blogs/entities/blog.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ export class Blog extends AbstractBaseEntity {
@Column({ nullable: true, default: null })
published_date?: Date;

@Column({ nullable: true, default: null })
last_updated_date?: Date;

@ManyToOne(() => User, user => user.blogs)
author: User;

@BeforeUpdate()
updateDate() {
this.last_updated_date = new Date();
}
}

0 comments on commit abfd92a

Please sign in to comment.