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

feat: 사용자 전체 스케줄 조회 (#5)

parent 9e6015f7
No related branches found
No related tags found
2 merge requests!31Develop,!6[#5] Schedule 서비스 로직 개발
......@@ -78,5 +78,31 @@ class schedulService {
}
}
/**
* 해당 사용자의 스케줄 정보 조회
*/
async getAllSchedules(userId) {
try {
const schedules = await Schedule.findAll({
where: {
user_id: userId,
[Op.or]: [
{ is_fixed: true },
{
is_fixed: false,
expiry_date: {
[Op.gt]: new Date()
}
}
]
},
order: [['start_time', 'ASC']]
});
return schedules;
} catch (error) {
throw new Error(`Failed to fetch schedules: ${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