Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions controller/timeStampController.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,19 @@ module.exports = {
try {
const userId = req.decoded.id;
const wakeUpTime = await userService.getWakeUpTime(userId);

if (!req.file) {
return res
.status(statusCode.BAD_REQUEST)
.send(
util.fail(
statusCode.BAD_REQUEST,
responseMessage.NO_IMAGE,
),
);
}
const timeStampImageUrl = req.file.location;

const { dateTime, timeStampContents } = req.body;

if (!dateTime || !timeStampContents || !timeStampImageUrl) {
Expand Down
1 change: 1 addition & 0 deletions modules/responseMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module.exports = {
READ_TIMESTAMP_ALL_FAIL: '전체 타임스탬프 조회 실패',
READ_TIMESTAMP_SUCCESS: '타임스탬프 조회 성공',
READ_TIMESTAMP_FAIL: '타임스탬프 조회 실패',
NO_IMAGE: '이미지 파일을 읽어올 수 없습니다.',
INVALID_TIMESTAMP_ID: '유효하지 않은 타임스탬프의 id값입니다.',

/* 캘린더 */
Expand Down