fix: empty payment list throwing error (#286)

Co-authored-by: Arun Raj M <jarnura47@gmail.com>
This commit is contained in:
Sangamesh Kulkarni
2023-01-05 11:53:57 +05:30
committed by GitHub
parent acb09b022c
commit def94eff2f

View File

@ -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,