Skip to content

Commit

Permalink
[MOD] response error 해결 #49
Browse files Browse the repository at this point in the history
  • Loading branch information
hujumee committed Jul 21, 2022
1 parent b2867b4 commit 4165126
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/controllers/MumentController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,11 @@ const getBanner = async (req: Request, res: Response) => {
const data = await MumentService.getBanner();

// 조회는 성공했으나, 결과값이 없는 경우
if (!data) {
res.status(statusCode.NO_CONTENT).send();
if (data === constant.NO_HOME_CONTENT) {
res.status(statusCode.NO_CONTENT).send(util.success(statusCode.NO_CONTENT, message.GET_BANNER_SUCCESS));
} else {
res.status(statusCode.OK).send(util.success(statusCode.OK, message.GET_BANNER_SUCCESS, data));
}

res.status(statusCode.OK).send(util.success(statusCode.OK, message.GET_BANNER_SUCCESS, data));
} catch (error) {
console.log(error);
res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, message.INTERNAL_SERVER_ERROR));
Expand Down

0 comments on commit 4165126

Please sign in to comment.