mirror of
https://github.com/MrSedan/neuro-reply-website.git
synced 2026-01-15 04:59:42 +03:00
Message entities in editing post
This commit is contained in:
@@ -12,4 +12,6 @@ export class ICreatePost {
|
|||||||
|
|
||||||
export class IEditPost {
|
export class IEditPost {
|
||||||
@ApiProperty({ description: 'Post text', example: 'Post text' }) readonly text!: string;
|
@ApiProperty({ description: 'Post text', example: 'Post text' }) readonly text!: string;
|
||||||
|
|
||||||
|
@ApiProperty({ description: 'Message entities of text', example: '[]' }) readonly message_entities?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,8 +60,9 @@ export class PostService {
|
|||||||
throw new HttpException('There are only ' + posts.length + ' unsent messages.', HttpStatus.BAD_REQUEST);
|
throw new HttpException('There are only ' + posts.length + ' unsent messages.', HttpStatus.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
const post = posts[Math.abs(+order) - 1];
|
const post = posts[Math.abs(+order) - 1];
|
||||||
if (post.text !== data.text) {
|
if (post.text !== data.text || post.message_entities !== data.message_entities) {
|
||||||
post.text = data.text;
|
post.text = data.text;
|
||||||
|
post.message_entities = data.message_entities;
|
||||||
post.edit_timestamp = new Date();
|
post.edit_timestamp = new Date();
|
||||||
await this.postRepository.save(post);
|
await this.postRepository.save(post);
|
||||||
}
|
}
|
||||||
|
|||||||
Submodule neuro-reply-bot-reworked updated: 5195325fd3...5b0580b477
Reference in New Issue
Block a user