Skip to content

Commit

Permalink
Merge pull request #57 from mash-up-kr/develop
Browse files Browse the repository at this point in the history
fix: add watch
  • Loading branch information
Hyun-git authored Oct 3, 2024
2 parents 90ed934 + a9fd14b commit 726efae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/controller/meme.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const createMeme = async (req: CustomRequest, res: Response, next: NextFunction)
image: image.location,
source: req.body.source,
keywordIds: req.body.keywordIds.map((id: string) => new Types.ObjectId(id)),
watch: 0,
};

try {
Expand Down
4 changes: 4 additions & 0 deletions src/model/meme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface IMemeCreatePayload {
title: string;
keywordIds: Types.ObjectId[];
image: string;
watch: number;
source: string;
}

Expand All @@ -23,6 +24,7 @@ export interface IMeme {
keywordIds: Types.ObjectId[];
image: string;
reaction: number;
watch: number;
source: string;
isTodayMeme: boolean;
}
Expand Down Expand Up @@ -50,6 +52,7 @@ export interface IMemeDocument extends Document {
keywordIds: Types.ObjectId[];
image: string;
reaction: number;
watch: number;
source: string;
isTodayMeme: boolean;
createdAt: Date;
Expand All @@ -64,6 +67,7 @@ const MemeSchema: Schema = new Schema(
keywordIds: { type: [Types.ObjectId], ref: 'Keyword', required: true, default: [] },
image: { type: String, required: true },
reaction: { type: Number, required: true, default: 0 },
watch: { type: Number, required: true, default: 0 },
source: { type: String, required: true, default: '' },
isTodayMeme: { type: Boolean, requried: true, default: false },
isDeleted: { type: Boolean, required: true, default: false },
Expand Down

0 comments on commit 726efae

Please sign in to comment.