Commit 0296c7cc authored by Johannes Zellner's avatar Johannes Zellner

inner join is overly wrong here, as we ignore projects without releases

parent ef32b42e
......@@ -66,7 +66,7 @@ function projectsList(userId, callback) {
assert.strictEqual(typeof userId, 'string');
assert.strictEqual(typeof callback, 'function');
db.query('SELECT projects.*,releases.version,releases.createdAt FROM projects INNER JOIN releases on releases.id = (SELECT releases.id FROM releases WHERE projectId=projects.id ORDER BY createdAt DESC LIMIT 1) WHERE userId=?', [ userId ], function (error, result) {
db.query('SELECT projects.*,releases.version,releases.createdAt FROM projects LEFT JOIN releases on releases.id = (SELECT releases.id FROM releases WHERE projectId=projects.id ORDER BY createdAt DESC LIMIT 1) WHERE userId=?', [ userId ], function (error, result) {
if (error) return callback(error);
result.forEach(projectPostprocess);
......
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