Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catalyst Signed Document POST endpoint. Proper CurrentPage response returning. #1690

Open
Mr-Leshiy opened this issue Jan 25, 2025 · 0 comments
Labels
F14 rust Pull requests that update Rust code

Comments

@Mr-Leshiy
Copy link
Contributor

Summary

Implement a proper page response filed setup

.

Description

Need to instantiate a proper CurrentPage structure object.

pub(crate) struct CurrentPage {
    #[allow(clippy::missing_docs_in_private_items)] // Type is pre documented
    pub page: common::types::generic::query::pagination::Page,
    #[allow(clippy::missing_docs_in_private_items)] // Type is pre documented
    pub limit: common::types::generic::query::pagination::Limit,
    #[allow(clippy::missing_docs_in_private_items)] // Type is pre documented
    pub remaining: common::types::generic::query::pagination::Remaining,
}

page and limit field could be defined from the endpoint request arguments.
remaining field should be calculated as a difference between the resulted number of elements returned by the query and the total amount of elements (applying the same filtering options).
It will be needed to add a new sql request as this https://github.com/input-output-hk/catalyst-voices/blob/f83a33f7c2a11607485ee6d19f33269e066187da/catalyst-gateway/bin/src/db/event/signed_docs/sql/filtered_select_signed_documents.sql.jinja, but it should SELECT just a count of rows.

@Mr-Leshiy Mr-Leshiy moved this from New to 🔖 Ready in Catalyst Jan 25, 2025
@Mr-Leshiy Mr-Leshiy added rust Pull requests that update Rust code F14 labels Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F14 rust Pull requests that update Rust code
Projects
Status: 🔖 Ready
Development

No branches or pull requests

1 participant