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

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

parent f441f5b7
No related branches found
No related tags found
2 merge requests!31Develop,!6[#5] Schedule 서비스 로직 개발
......@@ -58,5 +58,25 @@ class schedulService {
throw new Error(`Failed to update schedule: ${error.message}`);
}
}
/**
* 사용자 스케줄 삭제
*/
async deleteSchedule(id, userId) {
try {
const schedule = await Schedule.destroy({
where: { id, user_id: userId }
});
if (!schedule) {
throw new Error('schedule not found');
}
return true;
} catch (error) {
throw new Error(`Failed to delete 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