fix(bot): 봇 목록 API 수정 - JOIN 제거, ID 오름차순 정렬

- bots 테이블에서 직접 조회 (bot_youtube_config JOIN 제거)
- channel_id, rss_url 등이 bots 테이블에 직접 저장됨
- 정렬 순서: created_at DESC → id ASC
- 오류 발생 후 목록 갱신 추가
This commit is contained in:
caadiq 2026-01-05 22:51:37 +09:00
parent 4d37f0dfe2
commit 0c91abd722

View file

@ -1662,12 +1662,7 @@ router.delete("/schedules/:id", authenticateToken, async (req, res) => {
// 봇 목록 조회 // 봇 목록 조회
router.get("/bots", authenticateToken, async (req, res) => { router.get("/bots", authenticateToken, async (req, res) => {
try { try {
const [bots] = await pool.query( const [bots] = await pool.query(`SELECT * FROM bots ORDER BY id ASC`);
`SELECT b.*, c.channel_id, c.channel_name, c.rss_url, c.include_shorts
FROM bots b
LEFT JOIN bot_youtube_config c ON b.id = c.bot_id
ORDER BY b.created_at DESC`
);
res.json(bots); res.json(bots);
} catch (error) { } catch (error) {
console.error("봇 목록 조회 오류:", error); console.error("봇 목록 조회 오류:", error);