Commit 6db177d9 authored by Kim, Subin's avatar Kim, Subin
Browse files

schedule router 및 controller 작성 및 적용

parent 20930c8b
import { KU } from "../db/index.js";
const create = async (req, res) => {
try {
} catch (error) {
return res.status(500).send(error.message || "일정 등록 중 에러 발생")
}
}
const edit = async (req, res) => {
try {
} catch (error) {
return res.status(500).send(error.message || "일정 수정 중 에러 발생")
}
}
const remove = async (req, res) => {
try {
} catch (error) {
return res.status(500).send(error.message || "일정 삭제 중 에러 발생")
}
}
export default {
create,
edit,
remove
}
\ No newline at end of file
import { Schedule } from "../db/index.js";
const create = async (req, res) => {
try {
} catch (error) {
return res.status(500).send(error.message || "일정 등록 중 에러 발생")
}
}
const edit = async (req, res) => {
try {
} catch (error) {
return res.status(500).send(error.message || "일정 수정 중 에러 발생")
}
}
const remove = async (req, res) => {
try {
} catch (error) {
return res.status(500).send(error.message || "일정 삭제 중 에러 발생")
}
}
export default {
create,
edit,
remove
}
\ No newline at end of file
import express from "express"; import express from "express";
import userRouter from './user.route.js'; import userRouter from './user.route.js';
import scheduleRouter from "./schedule.route.js";
import subjectRouter from './subject.route.js'; import subjectRouter from './subject.route.js';
const router = express.Router(); const router = express.Router();
router.use('/auth', userRouter) router.use('/auth', userRouter)
router.use('/schedule', scheduleRouter)
router.use('/subject', subjectRouter) router.use('/subject', subjectRouter)
export default router; export default router;
\ No newline at end of file
import express from 'express';
import kuCtrl from "../controllers/ku.controller.js";
import scheduleCtrl from "../controllers/schedule.controller.js";
const router = express.Router();
router
.route("/ku")
.post(kuCtrl.create)
.put(kuCtrl.edit)
.delete(kuCtrl.remove)
router
.route("/:userId")
.post(scheduleCtrl.create)
.put(scheduleCtrl.edit)
.delete(scheduleCtrl.remove)
export default router;
\ No newline at end of file
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