mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-11-04 14:07:18 +08:00 
			
		
		
		
	fix: empty payment list throwing error (#286)
Co-authored-by: Arun Raj M <jarnura47@gmail.com>
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							acb09b022c
						
					
				
				
					commit
					def94eff2f
				
			@ -33,7 +33,7 @@ use crate::{
 | 
			
		||||
        storage::{self, enums as storage_enums},
 | 
			
		||||
        transformers::ForeignInto,
 | 
			
		||||
    },
 | 
			
		||||
    utils::{self, OptionExt},
 | 
			
		||||
    utils::OptionExt,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#[instrument(skip_all)]
 | 
			
		||||
@ -582,9 +582,6 @@ pub async fn list_payments(
 | 
			
		||||
        .into_iter()
 | 
			
		||||
        .map(ForeignInto::foreign_into)
 | 
			
		||||
        .collect();
 | 
			
		||||
    utils::when(data.is_empty(), || {
 | 
			
		||||
        Err(errors::ApiErrorResponse::PaymentNotFound)
 | 
			
		||||
    })?;
 | 
			
		||||
    Ok(services::BachResponse::Json(api::PaymentListResponse {
 | 
			
		||||
        size: data.len(),
 | 
			
		||||
        data,
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user