You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 8, 2026. It is now read-only.
// console.log("Fetching user by any ID:", user_id);
52
+
if(!user_id)
53
+
returnnull;
50
54
constusers=awaitthis.databaseService.read(`SELECT * FROM users WHERE ${UserService_1.getIdWhereClause(includeDisabled)}`,[user_id,user_id,user_id,user_id]);
51
55
returnusers.length>0 ? users[0] : null;
52
56
}
@@ -229,24 +233,24 @@ let UserService = UserService_1 = class UserService {
229
233
constquery=`
230
234
SELECT
231
235
u.*,
232
-
json_group_array(
236
+
CONCAT('[', GROUP_CONCAT(
233
237
CASE WHEN inv.item_id IS NOT NULL AND i.itemId IS NOT NULL THEN
234
-
json_object(
238
+
JSON_OBJECT(
235
239
'user_id', inv.user_id,
236
240
'item_id', inv.item_id,
237
241
'itemId', i.itemId,
238
242
'name', i.name,
239
243
'description', i.description,
240
244
'amount', inv.amount,
241
245
'iconHash', i.iconHash,
242
-
'sellable', CASE WHEN inv.sellable = 1 THEN 1 ELSE 0 END,
246
+
'sellable', IF(inv.sellable = 1, 1, 0),
243
247
'purchasePrice', inv.purchasePrice,
244
-
'metadata', CASE WHEN inv.metadata IS NOT NULL THEN json(inv.metadata) ELSE NULL END
248
+
'metadata', inv.metadata
245
249
)
246
250
END
247
-
) as inventory,
248
-
(SELECT json_group_array(
249
-
json_object(
251
+
), ']') as inventory,
252
+
(SELECT CONCAT('[', GROUP_CONCAT(
253
+
JSON_OBJECT(
250
254
'itemId', oi.itemId,
251
255
'name', oi.name,
252
256
'description', oi.description,
@@ -255,9 +259,9 @@ let UserService = UserService_1 = class UserService {
255
259
'iconHash', oi.iconHash,
256
260
'showInStore', oi.showInStore
257
261
)
258
-
) FROM items oi WHERE oi.owner = u.user_id AND (oi.deleted IS NULL OR oi.deleted = 0) AND oi.showInStore = 1 ORDER BY oi.name) as ownedItems,
259
-
(SELECT json_group_array(
260
-
json_object(
262
+
), ']') FROM items oi WHERE oi.owner = u.user_id AND (oi.deleted IS NULL OR oi.deleted = 0) AND oi.showInStore = 1 ORDER BY oi.name) as ownedItems,
263
+
(SELECT CONCAT('[', GROUP_CONCAT(
264
+
JSON_OBJECT(
261
265
'gameId', g.gameId,
262
266
'name', g.name,
263
267
'description', g.description,
@@ -278,7 +282,7 @@ let UserService = UserService_1 = class UserService {
278
282
'multiplayer', g.multiplayer,
279
283
'download_link', g.download_link
280
284
)
281
-
) FROM games g WHERE g.owner_id = u.user_id AND g.showInStore = 1 ORDER BY g.name) as createdGames
285
+
), ']') FROM games g WHERE g.owner_id = u.user_id AND g.showInStore = 1 ORDER BY g.name) as createdGames
282
286
FROM users u
283
287
LEFT JOIN inventories inv ON u.user_id = inv.user_id AND inv.amount > 0
284
288
LEFT JOIN items i ON inv.item_id = i.itemId AND (i.deleted IS NULL OR i.deleted = 0)
@@ -298,8 +302,20 @@ let UserService = UserService_1 = class UserService {
0 commit comments