Added edit_timestamp col to post

This commit is contained in:
2023-11-27 00:23:45 +03:00
parent 652e8c502e
commit 70168918a6
2 changed files with 4 additions and 1 deletions

View File

@@ -22,6 +22,9 @@ export class Post {
@Column({ type: 'timestamptz' }) @Column({ type: 'timestamptz' })
public timestamp!: Date; public timestamp!: Date;
@Column({ type: 'timestamptz', nullable: true })
public edit_timestamp?: Date;
@Column({ nullable: false }) @Column({ nullable: false })
public from_user_id!: string; public from_user_id!: string;

View File

@@ -41,7 +41,7 @@ export class PostService {
} }
if (post.text !== data.text) { if (post.text !== data.text) {
post.text = data.text; post.text = data.text;
post.timestamp = new Date(); post.edit_timestamp = new Date();
await this.postRepository.save(post); await this.postRepository.save(post);
} }
return post; return post;