diff options
author | Santo Cariotti <santo@dcariotti.me> | 2025-02-17 21:30:44 +0100 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2025-02-17 21:30:44 +0100 |
commit | c259ff6ea890aa671b6aee7080ce090da869785f (patch) | |
tree | 24d11ba6cfb61381273779b38e7f9b52d3db3eba | |
parent | 17dea3e6e32d0439278abd90c547926218f5e631 (diff) |
Check max(id) is uselessmain
Remove condition on SQL query since we have only one position per user
-rw-r--r-- | src/graphql/types/alert.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/graphql/types/alert.rs b/src/graphql/types/alert.rs index c38acf1..091d067 100644 --- a/src/graphql/types/alert.rs +++ b/src/graphql/types/alert.rs @@ -394,11 +394,7 @@ pub mod mutations { (SELECT area::geography FROM alerts WHERE id = $1), $2 ) - AND id = ( - SELECT MAX(id) - FROM positions - WHERE user_id = p.user_id - )", + ", &[&alert.id, &level.distance], ) .await? |