File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -241,10 +241,11 @@ async fn register_channel(
241241 }
242242
243243 if let Some ( ref resolved_owner_id) = owner_actor_id {
244- config_updates. insert (
245- "owner_id" . to_string ( ) ,
246- serde_json:: Value :: String ( resolved_owner_id. clone ( ) ) ,
247- ) ;
244+ let owner_id_value = resolved_owner_id
245+ . parse :: < i64 > ( )
246+ . map ( serde_json:: Value :: from)
247+ . unwrap_or_else ( |_| serde_json:: Value :: String ( resolved_owner_id. clone ( ) ) ) ;
248+ config_updates. insert ( "owner_id" . to_string ( ) , owner_id_value) ;
248249 }
249250
250251 if channel_name == TELEGRAM_CHANNEL_NAME
@@ -850,7 +851,7 @@ mod tests {
850851 let owner_id = runtime_config
851852 . get ( "owner_id" )
852853 . expect ( "owner_id should be in config" ) ;
853- assert_eq ! ( owner_id, & serde_json:: json!( " 12345" ) ) ;
854+ assert_eq ! ( owner_id, & serde_json:: json!( 12345 ) ) ;
854855 }
855856
856857 #[ tokio:: test]
You can’t perform that action at this time.
0 commit comments