Skip to content

Commit 665bebb

Browse files
committed
added total field and pages field to ChannelListResponse
1 parent 72059fa commit 665bebb

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

primitives/src/sentry.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ pub struct AggregateEvents {
127127
pub struct ChannelListResponse {
128128
pub channels: Vec<Channel>,
129129
pub total_pages: u64,
130+
pub total: u64,
131+
pub page: u64,
130132
}
131133

132134
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]

sentry/src/db/channel.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ mod list_channels {
125125
creator: &Option<String>,
126126
validator: &Option<ValidatorId>,
127127
valid_until_ge: &DateTime<Utc>,
128+
page: u64,
128129
) -> Result<ChannelListResponse, RunError<bb8_postgres::tokio_postgres::Error>> {
129130
let validator = validator.as_ref().map(|validator_id| {
130131
serde_json::Value::from_str(&format!(r#"[{{"id": "{}"}}]"#, validator_id))
@@ -168,6 +169,8 @@ mod list_channels {
168169

169170
Ok(ChannelListResponse {
170171
total_pages,
172+
total: total_pages,
173+
page,
171174
channels,
172175
})
173176
}

sentry/src/routes/channel.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ pub async fn channel_list<A: Adapter>(
8989
&query.creator,
9090
&query.validator,
9191
&query.valid_until_ge,
92+
query.page,
9293
)
9394
.await?;
9495

0 commit comments

Comments
 (0)