From 2c295ffd36255fad5fb79c81c0b40a83761fe475 Mon Sep 17 00:00:00 2001 From: Antony Kurniawan Date: Tue, 14 Oct 2025 11:02:04 +0700 Subject: [PATCH] fix: join table name --- db/tags.db.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/tags.db.js b/db/tags.db.js index ef93e96..4d2bdff 100644 --- a/db/tags.db.js +++ b/db/tags.db.js @@ -59,7 +59,7 @@ const getAllTagsDb = async (searchParams = {}) => { c.sub_section_name FROM m_tags a LEFT JOIN m_device b ON a.device_id = b.device_id - LEFT JOIN m_plant_subsection c ON a.sub_section_id = c.sub_section_id + LEFT JOIN m_plant_sub_section c ON a.sub_section_id = c.sub_section_id WHERE a.deleted_at IS NULL ${whereConditions.length > 0 ? ` AND ${whereConditions.join(" AND ")}` : ""} ${whereOrConditions ? ` ${whereOrConditions}` : ""} @@ -87,7 +87,7 @@ const getTagsByIdDb = async (id) => { c.sub_section_name FROM m_tags a LEFT JOIN m_device b ON a.device_id = b.device_id - LEFT JOIN m_plant_subsection c ON a.sub_section_id = c.sub_section_id + LEFT JOIN m_plant_sub_section c ON a.sub_section_id = c.sub_section_id WHERE a.tag_id = $1 AND a.deleted_at IS NULL `; const result = await pool.query(queryText, [id]);