mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 11:24:45 +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},
|
storage::{self, enums as storage_enums},
|
||||||
transformers::ForeignInto,
|
transformers::ForeignInto,
|
||||||
},
|
},
|
||||||
utils::{self, OptionExt},
|
utils::OptionExt,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[instrument(skip_all)]
|
#[instrument(skip_all)]
|
||||||
@ -582,9 +582,6 @@ pub async fn list_payments(
|
|||||||
.into_iter()
|
.into_iter()
|
||||||
.map(ForeignInto::foreign_into)
|
.map(ForeignInto::foreign_into)
|
||||||
.collect();
|
.collect();
|
||||||
utils::when(data.is_empty(), || {
|
|
||||||
Err(errors::ApiErrorResponse::PaymentNotFound)
|
|
||||||
})?;
|
|
||||||
Ok(services::BachResponse::Json(api::PaymentListResponse {
|
Ok(services::BachResponse::Json(api::PaymentListResponse {
|
||||||
size: data.len(),
|
size: data.len(),
|
||||||
data,
|
data,
|
||||||
|
|||||||
Reference in New Issue
Block a user