Skip to content

Commit 30c8c91

Browse files
committed
fix: ลำดับ route events ผิด
1 parent 4603aff commit 30c8c91

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

client/my-app/src/app/components/Layouts/Header.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ export default function Header({ userName = "Admin" }: { userName?: string }) {
3939
hour12: true,
4040
}).format(now);
4141

42-
console.log(me);
43-
4442
return (
4543
<header
4644
className="sticky top-0 z-40 w-full bg-[color:var(--color-white)]"

server/src/routes/events.routes.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ import * as ctrl from "../controllers/events.controller";
2929

3030
const router = Router();
3131

32+
/* ===================== Global Detection Settings ===================== */
33+
router.get("/global", ctrl.getGlobalEvents);
34+
router.get("/:evt_id/global", ctrl.getGlobalEventById);
35+
router.put("/:evt_id/global", ctrl.updateGlobalEvent);
36+
3237
/* ========================== Events ========================== */
3338
router.get("/", ctrl.getEvents);
3439
router.post("/", ctrl.createEvent);
3540
router.get("/:evt_id", ctrl.getEventById);
3641
router.put("/:evt_id", ctrl.updateEvent);
3742
router.patch("/:evt_id", ctrl.softDeleteEvent);
3843

39-
/* ===================== Global Detection Settings ===================== */
40-
router.get("/global", ctrl.getGlobalEvents);
41-
router.get("/:evt_id/global", ctrl.getGlobalEventById);
42-
router.put("/:evt_id/global", ctrl.updateGlobalEvent);
43-
4444
export default router;

server/src/services/events.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ export async function getGlobalEventById(event_id: number) {
269269
const { rows } = await pool.query(
270270
`
271271
SELECT * FROM v_events_overview
272-
WHERE event_id = $1;
272+
WHERE event_id = $1
273273
AND is_use = true;
274274
`,
275275
[event_id]

0 commit comments

Comments
 (0)