Skip to content

Commit

Permalink
Merge pull request #55 from mash-up-kr/fix/createMeme
Browse files Browse the repository at this point in the history
fix: Add keywordIds type check
  • Loading branch information
Hyun-git authored Sep 29, 2024
2 parents a02838f + 6588501 commit fcffbcf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/controller/meme.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ const createMeme = async (req: CustomRequest, res: Response, next: NextFunction)
return next(new CustomError(`'keywordIds' field should be provided`, HttpCode.BAD_REQUEST));
}

if (!Array.isArray(req.body.keywordIds)) {
return next(new CustomError(`'keywordIds' should be an array`, HttpCode.BAD_REQUEST));
}

const createPayload: IMemeCreatePayload = {
deviceId: user.deviceId,
title: req.body.title,
Expand Down

0 comments on commit fcffbcf

Please sign in to comment.