From c64a1f1996a77283eb613715449599f3d8cb32ae Mon Sep 17 00:00:00 2001 From: leca Date: Sat, 17 Aug 2024 06:02:16 +0300 Subject: [PATCH] fix read profiles --- src/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/user.js b/src/user.js index fab0d12..9ff7638 100644 --- a/src/user.js +++ b/src/user.js @@ -138,7 +138,7 @@ export class User { check_distance($6::double precision, $7::double precision, (SELECT lat FROM cities WHERE ID = location), (SELECT lng FROM cities WHERE ID = location), range)` } AND (interest = $4 OR interest = 'b') - AND NOT (room_id = ANY(ARRAY(SELECT recipient FROM read_profiles))) + AND NOT EXISTS(SELECT sender, recipient FROM read_profiles WHERE sender = $2 AND recipient = room_id) ORDER BY RANDOM() LIMIT 1`, [myage, this.roomId, myinterest, mysex, myrange, lat, lng]) ).rows[0];