File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change 11use async_graphql:: { Context , Object , Result } ;
2- use chrono_tz :: Asia :: Kolkata ;
2+ use chrono :: NaiveDate ;
33use sqlx:: PgPool ;
44use std:: sync:: Arc ;
55
@@ -14,15 +14,10 @@ impl StatusMutations {
1414 & self ,
1515 ctx : & Context < ' _ > ,
1616 emails : Vec < String > ,
17+ date : NaiveDate ,
1718 ) -> Result < Vec < StatusUpdateRecord > > {
1819 let pool = ctx. data :: < Arc < PgPool > > ( ) . expect ( "Pool must be in context" ) ;
1920 #[ allow( deprecated) ]
20- let yesterday = chrono:: Utc :: now ( )
21- . with_timezone ( & Kolkata )
22- . date ( )
23- . naive_local ( )
24- - chrono:: Duration :: days ( 1 ) ;
25-
2621 let status = sqlx:: query_as :: < _ , StatusUpdateRecord > (
2722 "UPDATE StatusUpdateHistory SET
2823 is_sent = true
@@ -32,7 +27,7 @@ impl StatusMutations {
3227 " ,
3328 )
3429 . bind ( emails)
35- . bind ( yesterday )
30+ . bind ( date )
3631 . fetch_all ( pool. as_ref ( ) )
3732 . await ?;
3833
You can’t perform that action at this time.
0 commit comments