mirror of
https://github.com/MrSedan/neuro-reply-website.git
synced 2026-01-14 20:49:42 +03:00
Added edit_timestamp col to post
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user