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
`DELETE FROM lockers_users WHERE id = (SELECT id FROM lockers_users WHERE user_id = $1 AND locker_id = $2 ORDER BY start_time DESC LIMIT 1)`,
200
+
[user.id,selectedLocker.id],
201
+
);
202
202
thrownewInternalServerErrorException('Failed to open locker');
203
203
}
204
204
return{success: true};
@@ -232,14 +232,10 @@ export class LockersService {
232
232
if(!success){
233
233
thrownewInternalServerErrorException('Failed to open locker');
234
234
}
235
-
awaitthis.lockersUsersRepository.update(
236
-
{
237
-
user,
238
-
locker: activeLocker,
239
-
},
240
-
{
241
-
end_time: newDate(),
242
-
},
235
+
236
+
awaitthis.lockersUsersRepository.query(
237
+
`UPDATE lockers_users SET end_time = NOW() WHERE id = (SELECT id FROM lockers_users WHERE user_id = $1 AND locker_id = $2 ORDER BY start_time DESC LIMIT 1)`,
238
+
[user.id,activeLocker.id],
243
239
);
244
240
return{success: true};
245
241
}
@@ -302,13 +298,9 @@ export class LockersService {
302
298
if(!success){
303
299
thrownewInternalServerErrorException('Failed to open locker');
304
300
}
305
-
awaitthis.lockersUsersRepository.update(
306
-
{
307
-
locker,
308
-
},
309
-
{
310
-
end_time: newDate(),
311
-
},
301
+
awaitthis.lockersUsersRepository.query(
302
+
`UPDATE lockers_users SET end_time = NOW() WHERE id = (SELECT id FROM lockers_users WHERE locker_id = $1 ORDER BY start_time DESC LIMIT 1)`,
0 commit comments