Commit f124b710 authored by Choi Ga Young's avatar Choi Ga Young
Browse files

이전에러

parent b3127999
......@@ -71,6 +71,7 @@ const Monthly = () => {
return (
<>
{console.log("usdiuasd==",scheduleList)}
<div ref={calenIconRef} className="position-absolute" style={{ top: "9px", right: "8px" }}>
<CalendarBtn date={moment(initialDate).format('DD')} />
</div>
......
......@@ -32,14 +32,16 @@ const ScheduleCarousel = () => {
<KU schedule={schedule} />
</div>) : null}
</div>
<button className="carousel-control-prev" type="button" data-bs-target="#scheduleListCarousel" data-bs-slide="prev">
<span className="carousel-control-prev-icon" aria-hidden="true"></span>
<span className="visually-hidden">Previous</span>
</button>
<button className="carousel-control-next" type="button" data-bs-target="#scheduleListCarousel" data-bs-slide="next">
<span className="carousel-control-next-icon" aria-hidden="true"></span>
<span className="visually-hidden">Next</span>
</button>
{scheduleList.length > 1 ? <>
<button className="carousel-control-prev" type="button" data-bs-target="#scheduleListCarousel" data-bs-slide="prev">
<span className="carousel-control-prev-icon" aria-hidden="true"></span>
<span className="visually-hidden">Previous</span>
</button>
<button className="carousel-control-next" type="button" data-bs-target="#scheduleListCarousel" data-bs-slide="next">
<span className="carousel-control-next-icon" aria-hidden="true"></span>
<span className="visually-hidden">Next</span>
</button>
</> : null}
</div>
)
}
......
......@@ -4,7 +4,7 @@
}
.inCard {
overflow: scroll;
overflow-y: auto;
}
.checkBox {
......
......@@ -24,12 +24,12 @@ const findbyId = async (req, res, next) => {
findSchedule = await Schedule.findOne({ where: { [Op.and]: [{ id: id }, { userId: userId }] } })
if (!findSchedule) throw new Error("해당 일정을 찾지 못했습니다.")
else {
const { id, title, start, end, allDay, location, memo } = findSchedule
const { id, title, start, end, allDay, location, memo, userId } = findSchedule
startDate = dateToString(start, "full")
endDate = dateToString(end, "full")
const startTime = dateToString(start, "time")
const endTime = dateToString(end, "time")
req.schedule = { id, title, startDate, endDate, startTime, endTime, allDay: allDay ? "on" : "off", location, memo }
req.schedule = { id, title, startDate, endDate, startTime, endTime, allDay: allDay ? "on" : "off", location, memo, userId }
}
}
next()
......@@ -88,7 +88,7 @@ const findbyDate = async (req, res, next) => {
end: {
[Op.gte]: endDate
}
}
}, { userId: req.userId }
]
}, order: [['updatedAt', 'DESC']]
})
......@@ -137,20 +137,25 @@ const findbyDate = async (req, res, next) => {
} else {
findIndividualList = await Schedule.findAll({
where: {
[Op.or]: [
[Op.and]: [
{ userId: req.userId },
{
[Op.and]: [
sequelize.where(sequelize.fn('date_part', 'year', sequelize.col('start')), year),
sequelize.where(sequelize.fn('date_part', 'month', sequelize.col('start')), month)
]
}, {
[Op.and]: [
sequelize.where(sequelize.fn('date_part', 'year', sequelize.col('end')), year),
sequelize.where(sequelize.fn('date_part', 'month', sequelize.col('end')), month)
[Op.or]: [
{
[Op.and]: [
sequelize.where(sequelize.fn('date_part', 'year', sequelize.col('start')), year),
sequelize.where(sequelize.fn('date_part', 'month', sequelize.col('start')), month)
]
}, {
[Op.and]: [
sequelize.where(sequelize.fn('date_part', 'year', sequelize.col('end')), year),
sequelize.where(sequelize.fn('date_part', 'month', sequelize.col('end')), month)
]
}
]
}
]
}, attributes: ['id', 'title', 'start', 'end']
}, attributes: ['id', 'title', 'start', 'end', 'userId']
, order: [['start']]
})
findIndividualList.forEach(schedule => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment