diff --git a/backend/libs/database/post.entity.ts b/backend/libs/database/post.entity.ts index 739d593..f2e53de 100644 --- a/backend/libs/database/post.entity.ts +++ b/backend/libs/database/post.entity.ts @@ -34,4 +34,7 @@ export class Post { @OneToMany(() => Image, (image) => image.post) public images: Image[]; + + @Column({ nullable: true }) + public message_entities?: string; } diff --git a/backend/src/modules/post/post.dto.ts b/backend/src/modules/post/post.dto.ts index 9c94994..88856d0 100644 --- a/backend/src/modules/post/post.dto.ts +++ b/backend/src/modules/post/post.dto.ts @@ -3,9 +3,11 @@ import { ApiProperty } from '@nestjs/swagger'; export class ICreatePost { @ApiProperty({ description: 'Post text', example: 'Post text' }) readonly text!: string; - @ApiProperty({ description: 'An id of user that creating post', example: '1234' }) readonly from_user_id!: string; + @ApiProperty({ description: 'The id of user that creating post', example: '1234' }) readonly from_user_id!: string; @ApiProperty({ description: 'Post media group id', example: '123' }) readonly media_group_id?: string; + + @ApiProperty({ description: 'Message entities of text', example: '[]' }) readonly message_entities?: string; } export class IEditPost { diff --git a/backend/src/modules/post/post.service.ts b/backend/src/modules/post/post.service.ts index 08ba6f1..bd72b3d 100644 --- a/backend/src/modules/post/post.service.ts +++ b/backend/src/modules/post/post.service.ts @@ -23,11 +23,12 @@ export class PostService { media_group_id: data.media_group_id, from_user: user, timestamp: new Date(), + message_entities: data.message_entities, }); this.logger.log(`Created new post: ${result.uuid}`); return result; } catch (error) { - this.logger.debug(`[post.newPost] error: ${JSON.stringify(error)}`); + this.logger.debug(`[post.newPost] error: ${error}`); throw new HttpException('No user with this id', HttpStatus.BAD_REQUEST); } } @@ -91,7 +92,7 @@ export class PostService { if (!post) throw new Error("Can't find post"); return post; } catch (error) { - this.logger.debug(`[post.getByMediaGroup] error: ${JSON.stringify(error)}`); + this.logger.debug(`[post.getByMediaGroup] error: ${error}`); throw new HttpException("Can't find post with this media group id", HttpStatus.BAD_REQUEST); } } diff --git a/neuro-reply-bot-reworked b/neuro-reply-bot-reworked index 43b1c5e..230850b 160000 --- a/neuro-reply-bot-reworked +++ b/neuro-reply-bot-reworked @@ -1 +1 @@ -Subproject commit 43b1c5ecf4bc1def0af2bc3750db4644715e7031 +Subproject commit 230850bf65064cfbda318e715741624fecaed5f6