trello-to-deck/src/nextcloud/board.rs
Paul Campbell 327e33a7e3
Some checks failed
Test / build (map[name:nightly]) (push) Successful in 2m51s
Test / build (map[name:stable]) (push) Successful in 6m36s
Release Please / Release-plz (push) Failing after 16s
feat(nextcloud): add basics of nextcloud config model client
2024-12-13 07:30:36 +00:00

22 lines
577 B
Rust

//
use kxio::net::Net;
use crate::{p, AppConfig, Ctx};
use crate::{p, FullCtx};
use super::DeckClient;
pub async fn list(ctx: FullCtx, dump: bool) -> color_eyre::Result<()> {
let dc = DeckClient::new(&ctx.cfg.nextcloud, ctx.net);
let apiresult = dc.get_boards().await;
if dump {
p!("{}", apiresult.text);
} else {
let mut boards = apiresult.result?;
boards.sort_by_key(|stack| stack.title.clone());
boards
.iter()
.for_each(|stack| p!("{}:{}", stack.id, stack.title));
}
Ok(())
}