Skip to content

Commit

Permalink
push
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiet1618 committed Nov 21, 2023
1 parent da452a8 commit e5eb2bd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/controllers/social.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export class SocialController {
bookmark: post.bookmark,
listLike: post.likes,
listComment: listOwnerComment,
tags: post.tags,
nft: nft,
postOwner: {
id: ownerPost.id,
Expand Down Expand Up @@ -93,6 +94,7 @@ export class SocialController {
bookmark: post.bookmark,
listLike: post.likes,
listComment: listOwnerComment,
tags: post.tags,
nft: nft,
postOwner: {
id: ownerPost.id,
Expand Down
6 changes: 5 additions & 1 deletion src/dtos/create-post.dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IsNotEmpty, IsNumber, IsString } from "class-validator";
import { IsArray, IsNotEmpty, IsNumber, IsString } from "class-validator";

export class CreatePostDto {

Expand All @@ -17,4 +17,8 @@ export class CreatePostDto {
@IsNumber()
@IsNotEmpty()
nftId: number;

@IsArray()
@IsNotEmpty()
tags: Array<string>;
}
3 changes: 3 additions & 0 deletions src/schemas/post.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@ export class Post {

@Prop({ default: [] })
bookmark: Array<string>;

@Prop({ default: [] })
tags: Array<string>;
}
export const PostSchema = SchemaFactory.createForClass(Post);
1 change: 1 addition & 0 deletions src/services/post.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export class PostService {
nftId: post.nftId,
header: post.header,
description: post.description,
tags: post.tags,
text: post.text,
timestamp: new Date().getTime(),
edited: false
Expand Down

0 comments on commit e5eb2bd

Please sign in to comment.