Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOTFIX] roomStartPOST API addFillTimelines 매개변수 오류 수정 #451

Merged
merged 1 commit into from
Oct 2, 2022
Merged
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
13 changes: 1 addition & 12 deletions functions/api/routes/room/roomStartPOST.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,6 @@ module.exports = async (req, res) => {

const entries = await roomDB.getEntriesByRoomIds(client, [roomId]);

const insertEntries = entries.map((o) => {
// 추가해줄 record들의 속성들 빚어주기
const startDate = dayjs(o.startAt);
const now = dayjs().add(9, 'hour');
const today = now.format('YYYY-MM-DD');
const day = dayjs(today).diff(startDate, 'day') + 1;
const queryParameter = '(' + o.entryId + ",'" + now.format('YYYY-MM-DD') + "'," + day + ')';

return queryParameter;
});

let insertRecords = [];
let insertTimelines = [];
for (let i = 0; i < entries.length; i++) {
Expand All @@ -87,7 +76,7 @@ module.exports = async (req, res) => {
await recordDB.insertRecords(client, insertRecords);

// 참여자들의 1일차 Life Timeline 생성
await lifeTimelineDB.addFillTimelines(client, insertEntries);
await lifeTimelineDB.addFillTimelines(client, insertTimelines);

const { title, body, isService, category } = alarmMessage.ROOM_NEW(room.roomName);

Expand Down