Major refactoring: Add user id to API routes

This commit is contained in:
Benjamin Toby
2024-11-27 11:02:03 +01:00
parent a529d0bd08
commit b047d6557c
21 changed files with 144 additions and 49 deletions
+5 -1
View File
@@ -178,7 +178,11 @@ function sqlGenerator({ tableName, genObject }) {
}
if (genObject.order)
queryString += ` ORDER BY ${genObject.order.field} ${genObject.order.strategy}`;
queryString += ` ORDER BY ${
genObject.join
? `${tableName}.${genObject.order.field}`
: genObject.order.field
} ${genObject.order.strategy}`;
if (genObject.limit) queryString += ` LIMIT ${genObject.limit}`;
return {