dt-common-device 13.0.14 → 13.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -70,12 +70,13 @@ let ConnectionRepository = (() => {
|
|
|
70
70
|
return result.rows[0];
|
|
71
71
|
}
|
|
72
72
|
async getConnectionsByPropertyId(propertyId) {
|
|
73
|
-
const result = await this.pool.query(
|
|
73
|
+
const result = await this.pool.query(`SELECT * FROM dt_connections WHERE "propertyId" = $1`, [propertyId]);
|
|
74
74
|
if (result.rows.length === 0)
|
|
75
75
|
return [];
|
|
76
76
|
return result.rows;
|
|
77
77
|
}
|
|
78
78
|
async queryConnections(query) {
|
|
79
|
+
console.log("queryConnections called with:", JSON.stringify(query, null, 2));
|
|
79
80
|
// Filter out undefined/null values and build WHERE clause
|
|
80
81
|
const conditions = [];
|
|
81
82
|
const values = [];
|
|
@@ -89,12 +90,16 @@ let ConnectionRepository = (() => {
|
|
|
89
90
|
paramIndex++;
|
|
90
91
|
}
|
|
91
92
|
});
|
|
93
|
+
console.log("Conditions:", conditions);
|
|
94
|
+
console.log("Values:", values);
|
|
92
95
|
// Build the SQL query
|
|
93
96
|
let sql = "SELECT * FROM dt_connections";
|
|
94
97
|
if (conditions.length > 0) {
|
|
95
98
|
sql += ` WHERE ${conditions.join(" AND ")}`;
|
|
96
99
|
}
|
|
100
|
+
console.log("SQL Query:", sql);
|
|
97
101
|
const result = await this.pool.query(sql, values);
|
|
102
|
+
console.log("Result:", result.rows);
|
|
98
103
|
return result.rows;
|
|
99
104
|
}
|
|
100
105
|
async updateConnection(connectionId, data) {
|