Skip to content
Snippets Groups Projects
Commit f441f5b7 authored by 조대희's avatar 조대희
Browse files

feat: 고정/유동 스케줄 수정 (#5)

parent 93b5e14e
No related branches found
No related tags found
2 merge requests!31Develop,!6[#5] Schedule 서비스 로직 개발
...@@ -36,4 +36,27 @@ class schedulService { ...@@ -36,4 +36,27 @@ class schedulService {
} }
} }
/**
* 사용자 스케줄 수정
*/
async updateSchedule(id, userId, updateData) {
try {
const schedule = await Schedule.findOne({
where: { id, user_id: userId }
});
if (!schedule) {
throw new Error('schedule not found');
}
// 스케줄 타입 변경하지 못하도록 update값 삭제 -> 기존값 유지
delete updateData.is_fixed;
await schedule.update(updateData);
return schedule;
} catch (error) {
throw new Error(`Failed to update schedule: ${error.message}`);
}
}
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment